chore: minor changes

This commit is contained in:
Maël Gangloff 2025-12-09 13:34:50 +01:00
parent 44cfe5a78e
commit f926ee50f9
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
3 changed files with 23 additions and 18 deletions

View File

@ -1,4 +1,4 @@
import {Button, ConfigProvider, Drawer, Flex, Layout, theme, Typography} from 'antd' import {Button, ConfigProvider, Drawer, Flex, Layout, message, theme, Typography} from 'antd'
import {Link, Navigate, Route, Routes, useLocation, useNavigate} from 'react-router-dom' import {Link, Navigate, Route, Routes, useLocation, useNavigate} from 'react-router-dom'
import TextPage from './pages/TextPage' import TextPage from './pages/TextPage'
import DomainSearchPage from './pages/search/DomainSearchPage' import DomainSearchPage from './pages/search/DomainSearchPage'
@ -20,7 +20,7 @@ import {MenuOutlined} from '@ant-design/icons'
import TrackedDomainPage from './pages/tracking/TrackedDomainPage' import TrackedDomainPage from './pages/tracking/TrackedDomainPage'
import IcannRegistrarPage from "./pages/infrastructure/IcannRegistrarPage" import IcannRegistrarPage from "./pages/infrastructure/IcannRegistrarPage"
import type {AuthContextType} from "./contexts" import type {AuthContextType} from "./contexts"
import { AuthenticatedContext, ConfigurationContext} from "./contexts" import {AuthenticatedContext, ConfigurationContext} from "./contexts"
const PROJECT_LINK = 'https://github.com/maelgangloff/domain-watchdog' const PROJECT_LINK = 'https://github.com/maelgangloff/domain-watchdog'
const LICENSE_LINK = 'https://www.gnu.org/licenses/agpl-3.0.txt' const LICENSE_LINK = 'https://www.gnu.org/licenses/agpl-3.0.txt'
@ -74,6 +74,7 @@ export default function App(): React.ReactElement {
const [darkMode, setDarkMode] = useState(false) const [darkMode, setDarkMode] = useState(false)
const windowQuery = window.matchMedia('(prefers-color-scheme:dark)') const windowQuery = window.matchMedia('(prefers-color-scheme:dark)')
const [messageApi, contextHolder] = message.useMessage()
const authContextValue: AuthContextType = useMemo(() => ({ const authContextValue: AuthContextType = useMemo(() => ({
@ -110,7 +111,7 @@ export default function App(): React.ReactElement {
if(configuration.publicRdapLookupEnabled) return navigate('/search/domain') if(configuration.publicRdapLookupEnabled) return navigate('/search/domain')
if (!['/login', '/tos', '/faq', '/privacy'].includes(pathname)) return navigate('/home') if (!['/login', '/tos', '/faq', '/privacy'].includes(pathname)) return navigate('/home')
}) })
}) }).catch(() => messageApi.error(t`Unable to contact the server, please reload the page.`))
}, []) }, [])
return ( return (
@ -139,6 +140,7 @@ export default function App(): React.ReactElement {
minHeight: 360 minHeight: 360
}} }}
> >
{contextHolder}
<Routes> <Routes>
<Route path='/' element={<Navigate to={configuration?.publicRdapLookupEnabled ? '/search/domain' : '/home'}/>}/> <Route path='/' element={<Navigate to={configuration?.publicRdapLookupEnabled ? '/search/domain' : '/home'}/>}/>
<Route path='/home' element={<TextPage resource='home.md'/>}/> <Route path='/home' element={<TextPage resource='home.md'/>}/>

View File

@ -20,7 +20,6 @@ export default function LoginPage() {
useEffect(() => { useEffect(() => {
if(!configuration?.registerEnabled && configuration?.ssoLogin && configuration?.ssoAutoRedirect) { if(!configuration?.registerEnabled && configuration?.ssoLogin && configuration?.ssoAutoRedirect) {
window.location.href = '/login/oauth' window.location.href = '/login/oauth'
return
} }
}, [configuration]) }, [configuration])

View File

@ -3,31 +3,35 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: assets/App.tsx:172 #: assets/App.tsx:114
msgid "TOS" msgid "Unable to contact the server, please reload the page."
msgstr ""
#: assets/App.tsx:173
msgid "Privacy Policy"
msgstr "" msgstr ""
#: assets/App.tsx:174 #: assets/App.tsx:174
msgid "TOS"
msgstr ""
#: assets/App.tsx:175
msgid "Privacy Policy"
msgstr ""
#: assets/App.tsx:176
msgid "FAQ" msgid "FAQ"
msgstr "" msgstr ""
#: assets/App.tsx:180 #: assets/App.tsx:182
msgid "Documentation" msgid "Documentation"
msgstr "" msgstr ""
#: assets/App.tsx:188 #: assets/App.tsx:190
msgid "Source code" msgid "Source code"
msgstr "" msgstr ""
#: assets/App.tsx:196 #: assets/App.tsx:198
msgid "Submit an issue" msgid "Submit an issue"
msgstr "" msgstr ""
#: assets/App.tsx:201 #: assets/App.tsx:203
#, javascript-format #, javascript-format
msgid "" msgid ""
"${ ProjectLink } is an open source project distributed under the ${ " "${ ProjectLink } is an open source project distributed under the ${ "
@ -87,7 +91,7 @@ msgid "Log in with SSO"
msgstr "" msgstr ""
#: assets/components/RegisterForm.tsx:54 #: assets/components/RegisterForm.tsx:54
#: assets/pages/LoginPage.tsx:51 #: assets/pages/LoginPage.tsx:50
msgid "Register" msgid "Register"
msgstr "" msgstr ""
@ -250,8 +254,8 @@ msgid "Log out"
msgstr "" msgstr ""
#: assets/components/Sider.tsx:158 #: assets/components/Sider.tsx:158
#: assets/pages/LoginPage.tsx:37 #: assets/pages/LoginPage.tsx:36
#: assets/pages/LoginPage.tsx:51 #: assets/pages/LoginPage.tsx:50
msgid "Log in" msgid "Log in"
msgstr "" msgstr ""
@ -690,7 +694,7 @@ msgstr ""
msgid "Sponsored Top-Level-Domains" msgid "Sponsored Top-Level-Domains"
msgstr "" msgstr ""
#: assets/pages/LoginPage.tsx:37 #: assets/pages/LoginPage.tsx:36
msgid "Create an account" msgid "Create an account"
msgstr "" msgstr ""