fix: use system theme by default
Some checks failed
Deploy Next.js application / deploy (push) Failing after 10m4s
Some checks failed
Deploy Next.js application / deploy (push) Failing after 10m4s
This commit is contained in:
parent
6859bc0ba2
commit
0ce17edbcb
2 changed files with 3 additions and 4 deletions
|
@ -50,8 +50,7 @@ export default function RootLayout({
|
|||
<body className={`antialiased ${poppins.className}`}>
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="dark"
|
||||
enableSystem
|
||||
enableSystem={true}
|
||||
disableTransitionOnChange
|
||||
>
|
||||
{children}
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue