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}`}>
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
enableSystem={true}
disableTransitionOnChange
>
{children}

View file

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