diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-17 17:13:51 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-17 18:03:52 +0100 |
| commit | 68138f0dcd8b3db2c23b31a20508726f245b5ba5 (patch) | |
| tree | 0d6a31cfd0adcba4d4cb08666bc262bed6cb89ea /src/pages/_app.tsx | |
| parent | 86d3e30ef02585d5089dce3aa2757ca2cb4e4edf (diff) | |
feat: implement dark mode
Diffstat (limited to 'src/pages/_app.tsx')
| -rw-r--r-- | src/pages/_app.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index fde93eb..a22c616 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -5,6 +5,7 @@ import { I18nProvider } from '@lingui/react'; import { AppPropsWithLayout } from '@ts/types/app'; import { initTranslation } from '@utils/helpers/i18n'; import '../styles/globals.scss'; +import { ThemeProvider } from 'next-themes'; initTranslation(i18n); @@ -29,7 +30,13 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) { const getLayout = Component.getLayout ?? ((page) => page); return ( <I18nProvider i18n={i18n}> - {getLayout(<Component {...pageProps} />)} + <ThemeProvider + defaultTheme="system" + enableColorScheme={true} + enableSystem={true} + > + {getLayout(<Component {...pageProps} />)} + </ThemeProvider> </I18nProvider> ); } |
