Add persistent flag of origin
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 1m12s
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 1m12s
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
"@uppy/react": "^4.0.1",
|
||||
"@uppy/tus": "^4.0.0",
|
||||
"@uppy/webcam": "^4.0.1",
|
||||
"country-flag-icons": "^1.5.13",
|
||||
"date-fns": "^4.1.0",
|
||||
"humanize-string": "2.1.0",
|
||||
"react": "18.3.1",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { hasFlag } from 'country-flag-icons'
|
||||
import { hydrateRoot, createRoot } from 'react-dom/client'
|
||||
|
||||
import App from 'src/App'
|
||||
@@ -15,6 +16,11 @@ if (!redwoodAppElement)
|
||||
"exists in your 'web/src/index.html' file."
|
||||
)
|
||||
|
||||
if (!hasFlag(process.env.COUNTRY))
|
||||
throw new Error(
|
||||
'Invalid COUNTRY environment variable, please select a valid ISO-3166-1 alpha-2 country code\n See https://en.wikipedia.org/wiki/ISO_3166-1#Codes'
|
||||
)
|
||||
|
||||
if (redwoodAppElement.children?.length > 0)
|
||||
hydrateRoot(redwoodAppElement, <App />)
|
||||
else {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { mdiCompass, mdiContacts } from '@mdi/js'
|
||||
import Icon from '@mdi/react'
|
||||
import getUnicodeFlagIcon from 'country-flag-icons/unicode'
|
||||
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
import { Metadata } from '@redwoodjs/web'
|
||||
@@ -44,6 +45,11 @@ const HomePage = () => (
|
||||
{getLogoComponent('gitea')}
|
||||
</a>
|
||||
</div>
|
||||
<div className="fixed bottom-2 right-2 z-10">
|
||||
<p className="btn btn-square text-xl">
|
||||
{getUnicodeFlagIcon(process.env.COUNTRY)}
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user