site updates

This commit is contained in:
Henry Dollman
2024-07-10 16:09:08 -04:00
parent 307218d001
commit 96e4c3b9ea
7 changed files with 91 additions and 36 deletions

View File

@@ -23,7 +23,7 @@ const ThemeProviderContext = createContext<ThemeProviderState>(initialState)
export function ThemeProvider({
children,
defaultTheme = 'system',
storageKey = 'vite-ui-theme',
storageKey = 'ui-theme',
...props
}: ThemeProviderProps) {
const [theme, setTheme] = useState<Theme>(
@@ -62,10 +62,4 @@ export function ThemeProvider({
)
}
export const useTheme = () => {
const context = useContext(ThemeProviderContext)
if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider')
return context
}
export const useTheme = () => useContext(ThemeProviderContext)