aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/_app.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-27 18:07:45 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:15:27 +0100
commit05f1dfc6896d3affa7c494a1b955f230d836a4b7 (patch)
tree3089d5c3145f241293b88b9a1bfe4bb85e8ca9e0 /src/pages/_app.tsx
parent757201fdc5c04a3f15504f74bf8ab85bb6018c2b (diff)
feat: replace next-themes with a custom ThemeProvider
To be honest, next-themes was working fine. However since I use a theme provider for Prism code blocks, some code is duplicated between this app and the library. So I prefer to use a custom Provider without the options I don't need.
Diffstat (limited to 'src/pages/_app.tsx')
-rw-r--r--src/pages/_app.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index c332432..0c92c93 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,5 +1,4 @@
import { useRouter } from 'next/router';
-import { ThemeProvider } from 'next-themes';
import { IntlProvider } from 'react-intl';
import '../styles/globals.scss';
import type { AppPropsWithLayout } from '../types';
@@ -9,6 +8,7 @@ import {
AckeeProvider,
MotionProvider,
PrismThemeProvider,
+ ThemeProvider,
} from '../utils/providers';
const App = ({ Component, pageProps }: AppPropsWithLayout) => {
@@ -34,9 +34,8 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
messages={translation}
>
<ThemeProvider
- defaultTheme="system"
- enableColorScheme={true}
- enableSystem={true}
+ attribute={STORAGE_KEY.THEME}
+ storageKey={STORAGE_KEY.THEME}
>
<PrismThemeProvider>
{getLayout(<Component {...componentProps} />, {})}