WIP/Experimental: Theme Switcher

This commit is contained in:
grimsi
2024-03-22 10:44:21 +01:00
parent ce9351f56b
commit 9424263c4a
10 changed files with 3092 additions and 1084 deletions
+20
View File
@@ -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)
}