feat(theme): wrap application in ThemeProvider for improved theme management

This commit is contained in:
cfngc4594 2025-02-19 21:20:25 +08:00
parent 273c8e6b67
commit 7c6c196cb2

View File

@ -1,6 +1,7 @@
import "./globals.css";
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google"; import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css"; import { ThemeProvider } from "@/components/theme-provider";
const geistSans = Geist({ const geistSans = Geist({
variable: "--font-geist-sans", variable: "--font-geist-sans",
@ -26,8 +27,15 @@ export default function RootLayout({
<html lang="en"> <html lang="en">
<body <body
className={`${geistSans.variable} ${geistMono.variable} antialiased`} className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
> >
{children} {children}
</ThemeProvider>
</body> </body>
</html> </html>
); );