Could we add a feature that detects if you are using dark mode, and swit

This commit is contained in:
Derek Slenk 2025-06-26 18:06:44 +00:00
parent 6b021fd315
commit a7476cb140
4 changed files with 32 additions and 3 deletions

View file

@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import './globals.css';
import { Toaster } from '@/components/ui/toaster';
import { ThemeProvider } from '@/components/theme-provider';
export const metadata: Metadata = {
title: 'Cheating Chelsea Exposed',
@ -14,7 +15,7 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
@ -28,8 +29,15 @@ export default function RootLayout({
/>
</head>
<body className="font-body antialiased">
{children}
<Toaster />
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
<Toaster />
</ThemeProvider>
</body>
</html>
);

View file

@ -0,0 +1,9 @@
"use client"
import * as React from "react"
import { ThemeProvider as NextThemesProvider } from "next-themes"
import type { ThemeProviderProps } from "next-themes/dist/types"
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
}