From 0ce17edbcbc26925ffc6436622ec3107cc9f9f14 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Wed, 18 Sep 2024 10:32:14 +0200 Subject: [PATCH] fix: use system theme by default --- app/layout.tsx | 3 +-- components/ui/theme-toggle.tsx | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index 72e1582..f1e9c9a 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -50,8 +50,7 @@ export default function RootLayout({ {children} diff --git a/components/ui/theme-toggle.tsx b/components/ui/theme-toggle.tsx index 289be39..94beaa8 100644 --- a/components/ui/theme-toggle.tsx +++ b/components/ui/theme-toggle.tsx @@ -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");