1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-22 22:54:22 +00:00
festa/pages/_app.tsx

37 lines
1.5 KiB
TypeScript
Raw Normal View History

2022-07-17 00:57:02 +00:00
import '../styles/globals.css'
import '@fortawesome/fontawesome-svg-core/styles.css'
2022-06-11 03:08:49 +00:00
import { AppProps } from 'next/app'
2022-06-04 03:13:19 +00:00
import { appWithTranslation, useTranslation } from 'next-i18next'
2022-07-16 18:01:19 +00:00
import { AxiosSWRFetcherProvider } from '../components/auth/requests'
2022-06-11 03:08:49 +00:00
import { PageErrorBoundary } from '../components/generic/errors/boundaries'
import { AuthContextProvider } from '../components/auth/provider'
2022-06-11 03:08:49 +00:00
import { PostcardRenderer } from '../components/postcard/renderer'
2022-07-16 18:01:19 +00:00
import { config as fontAwesomeConfig } from '@fortawesome/fontawesome-svg-core'
import { PostcardContextProvider } from '../components/postcard/provider'
2022-07-17 00:57:02 +00:00
import defaultPostcard from "../public/postcards/adi-goldstein-Hli3R6LKibo-unsplash.jpg"
2022-07-16 18:01:19 +00:00
fontAwesomeConfig.autoAddCss = false
2022-05-27 00:46:30 +00:00
2022-05-20 11:59:24 +00:00
2022-05-25 14:20:22 +00:00
const App = ({ Component, pageProps }: AppProps): JSX.Element => {
2022-06-09 21:43:38 +00:00
const { t } = useTranslation()
2022-05-31 15:07:25 +00:00
2022-06-11 03:08:49 +00:00
return (
<PageErrorBoundary text={t("genericError")}>
<AxiosSWRFetcherProvider>
<PostcardContextProvider defaultPostcard={defaultPostcard}>
<AuthContextProvider storageKey="auth">
2022-06-11 03:08:49 +00:00
<AxiosSWRFetcherProvider>
<PostcardRenderer />
<Component {...pageProps} />
</AxiosSWRFetcherProvider>
</AuthContextProvider>
</PostcardContextProvider>
2022-06-11 03:08:49 +00:00
</AxiosSWRFetcherProvider>
</PageErrorBoundary>
)
2022-05-20 11:59:24 +00:00
}
2022-05-25 14:20:22 +00:00
export default appWithTranslation(App)