fix(panel): reactive system theme detection

This commit is contained in:
Lemon-miaow committed 2026-06-28 03:41:50 +08:00
1 parent f5d00f389e
commit 832b200d55
5 files changed
+86 -92

No files matched your search

+3 -2
View File
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { NavLink, Outlet } from "react-router-dom";
import { Cat, Globe, Sun, Moon, LogOut, UserRound } from "lucide-react";
import { Cat, Globe, Sun, Moon, LogOut } from "lucide-react";
import { useTranslation } from "react-i18next";
import * as SelectPrimitive from "@radix-ui/react-select";
import { cn } from "@/lib/utils";
@@ -130,7 +130,8 @@ function ThemeToggle() {
aria-label={t("toggle_theme")}
title={t("toggle_theme")}
>
{theme === "light" ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
{theme === "light" && <Sun className="h-4 w-4" />}
{theme === "dark" && <Moon className="h-4 w-4" />}
</button>
);
}