mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
47f8febbd2
- Light/Dark Toggle works - Theme Preview works - TODO: Theme switching
23 lines
411 B
TypeScript
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)
|
|
}
|