File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- import { Component , createSignal } from "solid-js" ;
2
-
1
+ import { Component } from "solid-js" ;
2
+ import { createUserTheme } from "../" ;
3
3
const App : Component = ( ) => {
4
- const [ count , setCount ] = createSignal ( 0 ) ;
5
- const increment = ( ) => setCount ( count ( ) + 1 ) ;
4
+ const [ theme , setTheme ] = createUserTheme ( ) ;
5
+ const increment = ( ) => setTheme ( theme ( ) === "light" ? "dark" : "light" ) ;
6
6
return (
7
7
< div class = { `min-h-screen ${ "dark" == "dark" ? "dark" : "" } ` } >
8
8
< div class = "box-border flex min-h-screen w-full flex-col items-center justify-center space-y-4 bg-gray-800 p-24 text-white" >
9
9
< div class = "wrapper-v" >
10
10
< h4 > Counter component</ h4 >
11
11
< p class = "caption" > it's very important...</ p >
12
12
< button class = "btn" onClick = { increment } >
13
- { count ( ) }
13
+ { theme ( ) }
14
14
</ button >
15
15
</ div >
16
16
</ div >
You can’t perform that action at this time.
0 commit comments