fix: use system theme by default
Some checks failed
Deploy Next.js application / deploy (push) Failing after 10m4s

This commit is contained in:
Dorian Niemiec 2024-09-18 10:32:14 +02:00
parent 6859bc0ba2
commit 0ce17edbcb
2 changed files with 3 additions and 4 deletions

View file

@ -50,8 +50,7 @@ export default function RootLayout({
<body className={`antialiased ${poppins.className}`}> <body className={`antialiased ${poppins.className}`}>
<ThemeProvider <ThemeProvider
attribute="class" attribute="class"
defaultTheme="dark" enableSystem={true}
enableSystem
disableTransitionOnChange disableTransitionOnChange
> >
{children} {children}

View file

@ -11,10 +11,10 @@ import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
const ThemeToggle = () => { const ThemeToggle = () => {
const { theme, setTheme } = useTheme(); const { resolvedTheme, setTheme } = useTheme();
const handleTheme = () => { const handleTheme = () => {
if (theme == "light") { if (resolvedTheme == "light") {
setTheme("dark"); setTheme("dark");
} else { } else {
setTheme("light"); setTheme("light");