Skip to content

Commit 2cb1000

Browse files
committed
fix: move back to old theming
1 parent 8a39c14 commit 2cb1000

File tree

2 files changed

+38
-15
lines changed

2 files changed

+38
-15
lines changed

apps/website/src/app/layout.tsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { ServerThemeProvider } from 'next-themes';
1+
// import { ServerThemeProvider } from 'next-themes';
22
import type { PropsWithChildren } from 'react';
3+
import { Providers } from './providers';
34

45
import '@unocss/reset/tailwind.css';
56
import '../styles/inter.css';
@@ -9,19 +10,21 @@ import '../styles/main.css';
910

1011
export 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
}

apps/website/src/app/providers.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
}

0 commit comments

Comments
 (0)