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-07-19 17:51:14 +00:00
|
|
|
import { ErrorBoundaryView } from '../components/generic/errors/boundaries'
|
2022-07-17 01:49:37 +00:00
|
|
|
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'
|
2022-07-17 01:49:37 +00:00
|
|
|
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-19 18:06:26 +00:00
|
|
|
import { LoadingBoundaryMain } from '../components/generic/loading/boundaries'
|
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 (
|
2022-07-19 17:51:14 +00:00
|
|
|
<ErrorBoundaryView text={t("genericError")}>
|
2022-06-11 03:08:49 +00:00
|
|
|
<AxiosSWRFetcherProvider>
|
2022-07-17 01:49:37 +00:00
|
|
|
<PostcardContextProvider defaultPostcard={defaultPostcard}>
|
2022-07-17 00:55:36 +00:00
|
|
|
<AuthContextProvider storageKey="auth">
|
2022-06-11 03:08:49 +00:00
|
|
|
<AxiosSWRFetcherProvider>
|
|
|
|
<PostcardRenderer />
|
2022-07-19 17:51:14 +00:00
|
|
|
<ErrorBoundaryView text={t("genericError")}>
|
2022-07-19 18:06:26 +00:00
|
|
|
<LoadingBoundaryMain>
|
2022-07-18 22:42:56 +00:00
|
|
|
<Component {...pageProps} />
|
2022-07-19 18:06:26 +00:00
|
|
|
</LoadingBoundaryMain>
|
2022-07-19 17:51:14 +00:00
|
|
|
</ErrorBoundaryView>
|
2022-06-11 03:08:49 +00:00
|
|
|
</AxiosSWRFetcherProvider>
|
2022-07-17 00:55:36 +00:00
|
|
|
</AuthContextProvider>
|
2022-07-17 01:49:37 +00:00
|
|
|
</PostcardContextProvider>
|
2022-06-11 03:08:49 +00:00
|
|
|
</AxiosSWRFetcherProvider>
|
2022-07-19 17:51:14 +00:00
|
|
|
</ErrorBoundaryView>
|
2022-06-11 03:08:49 +00:00
|
|
|
)
|
2022-05-20 11:59:24 +00:00
|
|
|
}
|
|
|
|
|
2022-05-25 14:20:22 +00:00
|
|
|
export default appWithTranslation(App)
|