File tree Expand file tree Collapse file tree 2 files changed +38
-15
lines changed
Expand file tree Collapse file tree 2 files changed +38
-15
lines changed Original file line number Diff line number Diff line change 1- import { ServerThemeProvider } from 'next-themes' ;
1+ // import { ServerThemeProvider } from 'next-themes';
22import type { PropsWithChildren } from 'react' ;
3+ import { Providers } from './providers' ;
34
45import '@unocss/reset/tailwind.css' ;
56import '../styles/inter.css' ;
@@ -9,19 +10,21 @@ import '../styles/main.css';
910
1011export default function RootLayout ( { children } : PropsWithChildren ) {
1112 return (
12- < ServerThemeProvider
13- attribute = "class"
14- defaultTheme = "system"
15- disableTransitionOnChange
16- value = { {
17- light : 'light' ,
18- dark : 'dark' ,
19- } }
20- >
21- < html lang = "en" >
22- < head />
23- < body className = "dark:bg-dark-800 bg-white" > { children } </ body >
24- </ html >
25- </ ServerThemeProvider >
13+ // <ServerThemeProvider
14+ // attribute="class"
15+ // defaultTheme="system"
16+ // disableTransitionOnChange
17+ // value={{
18+ // light: 'light',
19+ // dark: 'dark',
20+ // }}
21+ // >
22+ < html lang = "en" >
23+ < head />
24+ < body className = "dark:bg-dark-800 bg-white" >
25+ < Providers > { children } </ Providers >
26+ </ body >
27+ </ html >
28+ // </ServerThemeProvider>
2629 ) ;
2730}
Original file line number Diff line number Diff line change 1+ 'use client' ;
2+
3+ import { ThemeProvider } from 'next-themes' ;
4+ import type { PropsWithChildren } from 'react' ;
5+
6+ export function Providers ( { children } : PropsWithChildren ) {
7+ return (
8+ < ThemeProvider
9+ attribute = "class"
10+ defaultTheme = "system"
11+ disableTransitionOnChange
12+ value = { {
13+ light : 'light' ,
14+ dark : 'dark' ,
15+ } }
16+ >
17+ { children }
18+ </ ThemeProvider >
19+ ) ;
20+ }
You can’t perform that action at this time.
0 commit comments