next-app-boilerplate/pages/_app.tsx
Walid 8d066ed42f
refactor: config with scss to tailwind (#42)
* fix: update deps and devDeps
* refactor(prettier): remove unwritten file names from formatter
* styles: remove stylelint & scss
* refactor: replace scss styles to tailwind
* feat: implement tailwind config
* refactor: update eslint config
* refactor(locales): replace autho's github url with repo itself
* refactor: change author's name license
* refactor(code): update code settings
* refactor: improve file components generators
* fix(code): add sharable config
* fix(linter): resolve bad parserConfig and linting itself
* refactor: bad imports
* refactor: update workflow with its scripts
2022-08-13 14:12:53 +01:00

24 lines
653 B
TypeScript

import '../styles/main.css'
import '@fontsource/open-sans'
import '@fontsource/open-sans/600.css'
import Cookies from 'js-cookie'
import type { AppProps } from 'next/app'
import useTranslation from 'next-translate/useTranslation'
import { useEffect } from 'react'
const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
const { lang } = useTranslation()
// 10 years before cookie's expiration
const COOKIE_EXPIRATION = 10 * 365.25 * 24 * 60 * 60
useEffect(() => {
Cookies.set('NEXT_LOCALE', lang, { expires: COOKIE_EXPIRATION })
}, [lang, COOKIE_EXPIRATION])
return <Component {...pageProps} />
}
export default MyApp