diff --git a/www/components/header.tsx b/www/components/header.tsx index c7fcac2..25664df 100644 --- a/www/components/header.tsx +++ b/www/components/header.tsx @@ -1,5 +1,5 @@ 'use client'; -import { useTheme } from 'next-themes'; +// import { useTheme } from 'next-themes'; import Image from 'next/image'; import Link from 'next/link'; import { DarkModeSwitch } from 'react-toggle-dark-mode'; @@ -10,15 +10,18 @@ import { departureMono } from '@/utils/fonts'; // import darkBanner from '@/public/bloom2x1dark.svg'; export function Header() { - const { theme, setTheme } = useTheme(); + // const { theme, setTheme } = useTheme(); + const [isDark, setIsDark] = useState(false); const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); + setIsDark(document.documentElement.classList.contains('dark')); }, []); const toggleDarkMode = (checked: boolean) => { - setTheme(checked ? 'dark' : 'light'); + document.documentElement.classList.toggle('dark'); + setIsDark(checked); }; if (!mounted) { @@ -35,7 +38,7 @@ export function Header() { return (