pass theme as context
This commit is contained in:
parent
ba56edf588
commit
8f497cae85
1 changed files with 37 additions and 41 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import {useStoredObjectState} from "./useStoredState.ts";
|
||||
import {useStoredObjectState} from './useStoredState.ts';
|
||||
import {createContext} from 'react';
|
||||
|
||||
export type Theme = {
|
||||
primary: HSL;
|
||||
|
|
@ -88,3 +89,5 @@ export function useStoredTheme() {
|
|||
save: applyTheme
|
||||
});
|
||||
}
|
||||
|
||||
export const ThemeContext = createContext<Theme>(getRandomTheme());
|
||||
|
|
|
|||
Reference in a new issue