feat(client): add shadcn theme

- Added Nix theme
- Defaults to dark mode

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2025-12-19 15:41:46 +08:00
parent ab87802fcf
commit 91be4eb7f6
4 changed files with 218 additions and 65 deletions

View File

@@ -0,0 +1,24 @@
import { createContext, use } from 'react';
export type Theme = 'dark' | 'light' | 'system';
interface ThemeProviderState {
theme: Theme;
setTheme: (theme: Theme) => void;
}
const initialState: ThemeProviderState = {
theme: 'system',
setTheme: () => null,
};
export const ThemeProviderContext = createContext<ThemeProviderState>(initialState);
export function useTheme() {
const context = use(ThemeProviderContext);
if (context === undefined)
throw new Error('useTheme must be used within a ThemeProvider');
return context;
}