@@ -10,7 +10,10 @@ import { useEmittor } from "emittor";
1010import { themeEmittor } from "../lib/emittors" ;
1111
1212function print ( ...props : any ) {
13- if ( typeof window !== "undefined" && ( window as any ) . shadcnThemeEditorDebugMode ) {
13+ if (
14+ typeof window !== "undefined" &&
15+ ( window as any ) . shadcnThemeEditorDebugMode
16+ ) {
1417 console . log ( ...props ) ;
1518 }
1619}
@@ -28,7 +31,6 @@ const ZodTheme = z.array(
2831) ;
2932
3033function SideBarColors ( ) {
31- // const { resolvedTheme: currentTheme } = useTheme();
3234
3335 const { resolvedTheme } = useTheme ( ) ;
3436 const [ currentTheme , setCurrentTheme ] = useState < string | undefined > ( ) ;
@@ -53,22 +55,16 @@ function SideBarColors() {
5355 const isValid = ZodTheme . parse ( theme ) ;
5456 print ( "theme is valid and appling" , isValid ) ;
5557 print ( "applied theme" , theme ) ;
56- themeEmittor . applyTheme ( theme )
57- // setColorsProperties(theme);
58- // setColors(theme);
58+ themeEmittor . applyTheme ( theme ) ;
5959 return ;
6060 } catch ( error ) {
6161 print ( "invalid theme found in localStorage" ) ;
6262 // localStorage.removeItem(LOCAL_STORAGE_KEY+":"+currentTheme); //* remove key
6363 }
6464 }
65- // resetTheme()
66- // theme = getColors(true) as any;
67- // theme = getDefaultTheme()
6865 print ( "theme not found in localStorage" ) ;
6966 print ( "Now theme: " , theme ) ;
70- // setColors(theme as any);
71- themeEmittor . setDefaultTheme ( )
67+ themeEmittor . setDefaultTheme ( ) ;
7268 } , [ currentTheme ] ) ;
7369 return (
7470 < >
0 commit comments