Add type to ThemeContext
This commit is contained in:
parent
81f124378f
commit
2f1221a568
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hibas123/theme-preact",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"description": "",
|
||||
"main": "out/index.js",
|
||||
"dependencies": {
|
||||
|
@ -25,7 +25,9 @@ export interface IThemeContext {
|
||||
mode: ThemeModes.DARK | ThemeModes.LIGHT;
|
||||
}
|
||||
|
||||
export const ThemeContext = createContext({});
|
||||
export const ThemeContext = createContext<IThemeContext>({
|
||||
mode: ThemeModes.LIGHT,
|
||||
});
|
||||
|
||||
const modeMediaQuery = window.matchMedia("prefers-color-scheme: dark");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user