|
1 |
| -import React, { createContext, useContext, useEffect, useRef, useState } from 'react' |
2 |
| -import { Outlet, useLocation, useNavigate, useParams } from 'react-router-dom' |
3 |
| -import { SnackbarProvider } from 'notistack' |
4 |
| -import { initShibbolethPinger } from 'unfuck-spa-shibboleth-session' |
| 1 | +import { Box, Button, CssBaseline, Snackbar } from '@mui/material' |
5 | 2 | import { ThemeProvider } from '@mui/material/styles'
|
| 3 | +import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3' |
6 | 4 | import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
|
7 | 5 | import { fi } from 'date-fns/locale'
|
8 |
| -import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3' |
9 |
| -import { Box, Button, CssBaseline, Snackbar } from '@mui/material' |
10 |
| -import { AppContext } from './contexts/AppContext' |
| 6 | +import { SnackbarProvider } from 'notistack' |
| 7 | +import React, { useEffect, useRef } from 'react' |
| 8 | +import { Outlet, useLocation, useParams } from 'react-router-dom' |
| 9 | +import { initShibbolethPinger } from 'unfuck-spa-shibboleth-session' |
11 | 10 | import { PUBLIC_URL } from '../config'
|
12 |
| -import type { User } from './types' |
13 |
| -import useTheme from './theme' |
14 |
| -import NavBar from './components/NavBar' |
| 11 | +import { Feedback } from './components/Feedback' |
15 | 12 | import Footer from './components/Footer'
|
16 |
| -import useCurrentUser from './hooks/useCurrentUser' |
| 13 | +import NavBar from './components/NavBar' |
| 14 | +import { AppContext } from './contexts/AppContext' |
17 | 15 | import { EmbeddedProvider, useIsEmbedded } from './contexts/EmbeddedContext'
|
18 |
| -import { Feedback } from './components/Feedback' |
| 16 | +import useCurrentUser from './hooks/useCurrentUser' |
19 | 17 | import { AnalyticsProvider } from './stores/analytics'
|
20 |
| -import { useTranslation } from 'react-i18next' |
21 |
| -import { useUpdateUrlLang } from './hooks/useUpdateUrlLang.tsx' |
| 18 | +import useTheme from './theme' |
| 19 | +import type { User } from './types' |
22 | 20 |
|
23 | 21 | const hasAccess = (user: User | null | undefined, courseId?: string) => {
|
24 | 22 | if (!user) return false
|
@@ -73,7 +71,7 @@ const AdminLoggedInAsBanner = () => {
|
73 | 71 | }
|
74 | 72 |
|
75 | 73 | const App = () => {
|
76 |
| - const urlUpdater = useUpdateUrlLang() //DONT REMOVE, the hook creates 2 useEffects to keep the url param synced with user language changes |
| 74 | + useUpdateUrlLang() |
77 | 75 | const theme = useTheme()
|
78 | 76 | const { courseId } = useParams()
|
79 | 77 | const location = useLocation()
|
|
0 commit comments