From 68138f0dcd8b3db2c23b31a20508726f245b5ba5 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 17 Jan 2022 17:13:51 +0100
Subject: feat: implement dark mode

---
 src/pages/_app.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/pages/_app.tsx')

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>
   );
 }
-- 
cgit v1.2.3

