2021-10-24 05:19:39 +02:00
|
|
|
import { useEffect } from 'react'
|
|
|
|
import { AppProps } from 'next/app'
|
2021-10-24 05:48:06 +02:00
|
|
|
import { ThemeProvider } from 'next-themes'
|
2021-10-24 05:19:39 +02:00
|
|
|
import useTranslation from 'next-translate/useTranslation'
|
|
|
|
|
2022-03-16 12:18:09 +01:00
|
|
|
import '../styles/global.css'
|
2021-10-24 05:19:39 +02:00
|
|
|
|
2021-10-24 05:48:06 +02:00
|
|
|
import '@fontsource/montserrat/400.css'
|
|
|
|
import '@fontsource/montserrat/500.css'
|
|
|
|
import '@fontsource/montserrat/600.css'
|
|
|
|
import '@fontsource/montserrat/700.css'
|
2021-10-24 05:19:39 +02:00
|
|
|
|
|
|
|
import '@fontsource/roboto/400.css'
|
|
|
|
import '@fontsource/roboto/700.css'
|
|
|
|
|
2022-03-16 12:18:09 +01:00
|
|
|
import { cookies } from '../tools/cookies'
|
2021-10-24 05:48:06 +02:00
|
|
|
|
|
|
|
const Application = ({ Component, pageProps }: AppProps): JSX.Element => {
|
2021-10-24 05:19:39 +02:00
|
|
|
const { lang } = useTranslation()
|
|
|
|
|
|
|
|
useEffect(() => {
|
2022-02-19 23:20:33 +01:00
|
|
|
cookies.set('NEXT_LOCALE', lang)
|
2022-04-07 16:54:05 +02:00
|
|
|
const appHeight = (): void => {
|
|
|
|
document.documentElement.style.setProperty(
|
|
|
|
'--app-height',
|
|
|
|
`${window.innerHeight}px`
|
|
|
|
)
|
|
|
|
}
|
|
|
|
window.addEventListener('resize', appHeight)
|
|
|
|
appHeight()
|
2021-10-24 05:19:39 +02:00
|
|
|
}, [lang])
|
|
|
|
|
|
|
|
return (
|
2021-10-24 05:48:06 +02:00
|
|
|
<ThemeProvider attribute='class' defaultTheme='dark'>
|
|
|
|
<Component {...pageProps} />
|
|
|
|
</ThemeProvider>
|
2021-10-24 05:19:39 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-10-24 05:48:06 +02:00
|
|
|
export default Application
|