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}`}>
|
<body className={`antialiased ${poppins.className}`}>
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
attribute="class"
|
attribute="class"
|
||||||
defaultTheme="dark"
|
enableSystem={true}
|
||||||
enableSystem
|
|
||||||
disableTransitionOnChange
|
disableTransitionOnChange
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -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");
|
||||||
|
|
Loading…
Reference in a new issue