Files
gameyfin/frontend/@/hooks/useConfig.ts
T
grimsi 47f8febbd2 WIP: Theme switcher
- Light/Dark Toggle works
- Theme Preview works
- TODO: Theme switching
2024-04-08 11:33:47 +02:00

23 lines
411 B
TypeScript

import {useAtom} from "jotai"
import {atomWithStorage} from "jotai/utils"
import {Theme} from "@/registry/themes"
type Config = {
theme: {
name: Theme["name"],
mode: "light" | "dark" | "system"
}
}
const configAtom = atomWithStorage<Config>("config", {
theme: {
name: "zinc",
mode: "system"
}
})
export function useConfig() {
return useAtom(configAtom)
}