feat: implement 4-theme system with Zustand persistence
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
20
apps/web/stores/theme-store.ts
Normal file
20
apps/web/stores/theme-store.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import type { ThemeName } from '@/themes';
|
||||
|
||||
interface ThemeState {
|
||||
theme: ThemeName;
|
||||
setTheme: (theme: ThemeName) => void;
|
||||
}
|
||||
|
||||
export const useThemeStore = create<ThemeState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
theme: 'light',
|
||||
setTheme: (theme) => set({ theme }),
|
||||
}),
|
||||
{
|
||||
name: 'horux-theme',
|
||||
}
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user