mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-10-15 11:15:45 -04:00
fix: theme toggle no-op on first click in system mode
Use resolvedTheme instead of theme so the toggle flips what is actually displayed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 file changed
+2
-2
@@ -266,7 +266,7 @@ const ContactPopover = () => (
|
||||
|
||||
const Header = ({ className }: { className?: string }) => {
|
||||
const [isScrolled, setIsScrolled] = useState(false);
|
||||
const { theme, setTheme } = useTheme();
|
||||
const { resolvedTheme, setTheme } = useTheme();
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => {
|
||||
@@ -330,7 +330,7 @@ const Header = ({ className }: { className?: string }) => {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
|
||||
onClick={() => setTheme(resolvedTheme === "dark" ? "light" : "dark")}
|
||||
aria-label="Toggle theme"
|
||||
className="group"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user