chore: Add next-themes npm dependency and update layout.tsx to use ThemeProvider

This commit is contained in:
Mauro Balades
2024-07-03 14:29:50 +02:00
parent f8b12599c8
commit ef3e94cb8d
8 changed files with 33 additions and 110 deletions

View File

@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/components/theme-provider"
const inter = Inter({ subsets: ["latin"] });
@@ -15,8 +16,17 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<html lang="en" suppressHydrationWarning >
<body className={inter.className}>
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
</body>
</html>
);
}