@@ -10,7 +10,10 @@ import { useEmittor } from "emittor";
10
10
import { themeEmittor } from "../lib/emittors" ;
11
11
12
12
function print ( ...props : any ) {
13
- if ( typeof window !== "undefined" && ( window as any ) . shadcnThemeEditorDebugMode ) {
13
+ if (
14
+ typeof window !== "undefined" &&
15
+ ( window as any ) . shadcnThemeEditorDebugMode
16
+ ) {
14
17
console . log ( ...props ) ;
15
18
}
16
19
}
@@ -28,7 +31,6 @@ const ZodTheme = z.array(
28
31
) ;
29
32
30
33
function SideBarColors ( ) {
31
- // const { resolvedTheme: currentTheme } = useTheme();
32
34
33
35
const { resolvedTheme } = useTheme ( ) ;
34
36
const [ currentTheme , setCurrentTheme ] = useState < string | undefined > ( ) ;
@@ -53,22 +55,16 @@ function SideBarColors() {
53
55
const isValid = ZodTheme . parse ( theme ) ;
54
56
print ( "theme is valid and appling" , isValid ) ;
55
57
print ( "applied theme" , theme ) ;
56
- themeEmittor . applyTheme ( theme )
57
- // setColorsProperties(theme);
58
- // setColors(theme);
58
+ themeEmittor . applyTheme ( theme ) ;
59
59
return ;
60
60
} catch ( error ) {
61
61
print ( "invalid theme found in localStorage" ) ;
62
62
// localStorage.removeItem(LOCAL_STORAGE_KEY+":"+currentTheme); //* remove key
63
63
}
64
64
}
65
- // resetTheme()
66
- // theme = getColors(true) as any;
67
- // theme = getDefaultTheme()
68
65
print ( "theme not found in localStorage" ) ;
69
66
print ( "Now theme: " , theme ) ;
70
- // setColors(theme as any);
71
- themeEmittor . setDefaultTheme ( )
67
+ themeEmittor . setDefaultTheme ( ) ;
72
68
} , [ currentTheme ] ) ;
73
69
return (
74
70
< >
0 commit comments