Skip to content

Commit

Permalink
Fix Revert merge
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Oct 28, 2024
1 parent 3f0524c commit 9ffd04b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CustomGlobalStyle } from '@components/CustomGlobalStyle'
import { FrontendErrorBoundary } from '@components/FrontendErrorBoundary'
import { useMatomo } from '@hooks/useMatomo'
import { GlobalStyle, THEME, ThemeProvider } from '@mtes-mct/monitor-ui'
import { LandingPage } from '@pages/LandingPage'
import { UnsupportedBrowserPage } from '@pages/UnsupportedBrowserPage'
import { isBrowserSupported } from '@utils/isBrowserSupported'
import { UserAccountContext } from 'context/UserAccountContext'
Expand All @@ -11,12 +12,22 @@ import { RouterProvider } from 'react-router-dom'
import { CustomProvider as RsuiteCustomProvider } from 'rsuite'
import rsuiteFrFr from 'rsuite/locales/fr_FR'

import { useCustomAuth } from './auth/hooks/useCustomAuth'
import { router } from './router'

countries.registerLocale(COUNTRIES_FR)

export function App() {
useMatomo()
const { isAuthorized, isLoading, userAccount } = useCustomAuth()

if (isLoading) {
return <LandingPage />
}

if (!isAuthorized || !userAccount) {
return <LandingPage hasInsufficientRights />
}

if (!isBrowserSupported()) {
return <UnsupportedBrowserPage />
Expand Down

0 comments on commit 9ffd04b

Please sign in to comment.