mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-30 10:25:05 +08:00
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:
@@ -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")}
|
||||
|
||||
Reference in New Issue
Block a user