fix: save dark/light mode selection to DB

This commit is contained in:
kovakmedya
2026-05-08 18:13:25 +03:00
parent c370949671
commit ba296fb3e4
2 changed files with 6 additions and 1 deletions
@@ -187,6 +187,7 @@ export function ThemeCustomizer({ open, onOpenChange, initialPrefs }: ThemeCusto
}}
setImportedTheme={setImportedTheme}
onImportClick={handleImportClick}
onThemeModeChange={(mode) => savePrefs({ theme: mode })}
/>
</TabsContent>
@@ -24,6 +24,7 @@ interface ThemeTabProps {
setSelectedRadius: (radius: string) => void
setImportedTheme: (theme: ImportedTheme | null) => void
onImportClick: () => void
onThemeModeChange: (mode: "light" | "dark") => void
}
export function ThemeTab({
@@ -34,7 +35,8 @@ export function ThemeTab({
selectedRadius,
setSelectedRadius,
setImportedTheme,
onImportClick
onImportClick,
onThemeModeChange,
}: ThemeTabProps) {
const {
isDarkMode,
@@ -76,11 +78,13 @@ export function ThemeTab({
const handleLightMode = (event: React.MouseEvent<HTMLButtonElement>) => {
if (isDarkMode === false) return
toggleTheme(event)
onThemeModeChange("light")
}
const handleDarkMode = (event: React.MouseEvent<HTMLButtonElement>) => {
if (isDarkMode === true) return
toggleTheme(event)
onThemeModeChange("dark")
}
return (