File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import useRGS from "r18gs";
2
2
import type { SetStateAction } from "r18gs/use-rgs" ;
3
3
import * as React from "react" ;
4
4
import type { ColorSchemePreference , ThemeState } from "../../hooks/use-theme" ;
5
- import { DEFAULT_ID } from "../../hooks/use-theme " ;
5
+ import { DEFAULT_ID } from "../../constants " ;
6
6
7
7
export interface ThemeSwitcherProps {
8
8
/** id of target element to apply classes to. This is useful when you want to apply theme only to specific container. */
Original file line number Diff line number Diff line change
1
+ /** shared constants -- keep in separate files for better tree-shaking and dependency injection */
2
+ export const DEFAULT_ID = "nthul" ;
Original file line number Diff line number Diff line change 1
1
import useRGS from "r18gs" ;
2
+ import { DEFAULT_ID } from "../constants" ;
2
3
3
4
export type ColorSchemePreference = "system" | "dark" | "light" ;
4
5
@@ -8,9 +9,7 @@ export interface ThemeState {
8
9
theme : string ;
9
10
}
10
11
11
- export const DEFAULT_ID = "nthul" ;
12
-
13
- export const DEFAULT_THEME_STATE = {
12
+ const DEFAULT_THEME_STATE = {
14
13
colorSchemePreference : "system" as ColorSchemePreference ,
15
14
systemColorScheme : "light" as "light" | "dark" ,
16
15
theme : "" ,
You can’t perform that action at this time.
0 commit comments