refactor(theme): drop unused MouseEvent param from setTheme

Now that the view transition animation is gone, setTheme no longer
needs click coordinates. Reduce the API surface to (theme: Theme) =>
void and simplify the call sites in mode-toggle and ThemeSettings.
This commit is contained in:
Jason
2026-05-02 17:38:37 +08:00
parent bc1f9341f4
commit 8e59a634fd
3 changed files with 7 additions and 9 deletions
+3 -3
View File
@@ -19,21 +19,21 @@ export function ThemeSettings() {
<div className="inline-flex gap-1 rounded-md border border-border-default bg-background p-1">
<ThemeButton
active={theme === "light"}
onClick={(e) => setTheme("light", e)}
onClick={() => setTheme("light")}
icon={Sun}
>
{t("settings.themeLight")}
</ThemeButton>
<ThemeButton
active={theme === "dark"}
onClick={(e) => setTheme("dark", e)}
onClick={() => setTheme("dark")}
icon={Moon}
>
{t("settings.themeDark")}
</ThemeButton>
<ThemeButton
active={theme === "system"}
onClick={(e) => setTheme("system", e)}
onClick={() => setTheme("system")}
icon={Monitor}
>
{t("settings.themeSystem")}