revert: theme fix

This commit is contained in:
iCrawl
2022-11-30 04:41:07 +01:00
parent 2cb1000a3a
commit 72c30d1578
2 changed files with 15 additions and 38 deletions

View File

@@ -1,6 +1,5 @@
// import { ServerThemeProvider } from 'next-themes'; import { ServerThemeProvider } from 'next-themes';
import type { PropsWithChildren } from 'react'; import type { PropsWithChildren } from 'react';
import { Providers } from './providers';
import '@unocss/reset/tailwind.css'; import '@unocss/reset/tailwind.css';
import '../styles/inter.css'; import '../styles/inter.css';
@@ -10,21 +9,19 @@ import '../styles/main.css';
export default function RootLayout({ children }: PropsWithChildren) { export default function RootLayout({ children }: PropsWithChildren) {
return ( return (
// <ServerThemeProvider <ServerThemeProvider
// attribute="class" attribute="class"
// defaultTheme="system" defaultTheme="system"
// disableTransitionOnChange disableTransitionOnChange
// value={{ value={{
// light: 'light', light: 'light',
// dark: 'dark', dark: 'dark',
// }} }}
// > >
<html lang="en"> <html lang="en">
<head /> <head />
<body className="dark:bg-dark-800 bg-white"> <body className="dark:bg-dark-800 bg-white">{children}</body>
<Providers>{children}</Providers> </html>
</body> </ServerThemeProvider>
</html>
// </ServerThemeProvider>
); );
} }

View File

@@ -1,20 +0,0 @@
'use client';
import { ThemeProvider } from 'next-themes';
import type { PropsWithChildren } from 'react';
export function Providers({ children }: PropsWithChildren) {
return (
<ThemeProvider
attribute="class"
defaultTheme="system"
disableTransitionOnChange
value={{
light: 'light',
dark: 'dark',
}}
>
{children}
</ThemeProvider>
);
}