mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 08:15:48 +00:00
WIP/Experimental: Theme Switcher
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import {useAtom} from "jotai"
|
||||
import {atomWithStorage} from "jotai/utils"
|
||||
|
||||
import {Theme} from "@/registry/themes"
|
||||
|
||||
type Config = {
|
||||
theme: Theme["name"]
|
||||
mode: "light" | "dark",
|
||||
radius: number
|
||||
}
|
||||
|
||||
const configAtom = atomWithStorage<Config>("config", {
|
||||
theme: "zinc",
|
||||
mode: "light",
|
||||
radius: 0.5,
|
||||
})
|
||||
|
||||
export function useConfig() {
|
||||
return useAtom(configAtom)
|
||||
}
|
||||
Reference in New Issue
Block a user