mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-14 04:25:35 +01:00
testing theme editor
This commit is contained in:
19
packages/web/src/stores/theme.tsx
Normal file
19
packages/web/src/stores/theme.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { create } from "zustand"
|
||||
import { persist } from "zustand/middleware"
|
||||
|
||||
type ThemeState = {
|
||||
backgroundUrl: string | null
|
||||
setBackground: (_url: string | null) => void
|
||||
reset: () => void
|
||||
}
|
||||
|
||||
export const useThemeStore = create<ThemeState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
backgroundUrl: null,
|
||||
setBackground: (backgroundUrl) => set({ backgroundUrl }),
|
||||
reset: () => set({ backgroundUrl: null }),
|
||||
}),
|
||||
{ name: "theme-preferences" },
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user