1- import * as React from " react" ;
2- import { createTheming } from " ../.." ;
1+ import * as React from ' react' ;
2+ import { createTheming } from ' ../..' ;
33
44type Theme = {
55 primaryColor : string ;
@@ -11,24 +11,22 @@ type Theme = {
1111
1212const themes : { [ key : string ] : Theme } = {
1313 default : {
14- primaryColor : " #FFA72A" ,
15- accentColor : " #458622" ,
16- backgroundColor : " #FFC777" ,
17- textColor : " #504f4d" ,
18- secondaryColor : " #7F5315"
14+ primaryColor : ' #FFA72A' ,
15+ accentColor : ' #458622' ,
16+ backgroundColor : ' #FFC777' ,
17+ textColor : ' #504f4d' ,
18+ secondaryColor : ' #7F5315' ,
1919 } ,
2020 dark : {
21- primaryColor : " #FFA72A" ,
22- accentColor : " #458622" ,
23- backgroundColor : " #504f4d" ,
24- textColor : " #FFC777" ,
25- secondaryColor : " #252525"
26- }
21+ primaryColor : ' #FFA72A' ,
22+ accentColor : ' #458622' ,
23+ backgroundColor : ' #504f4d' ,
24+ textColor : ' #FFC777' ,
25+ secondaryColor : ' #252525' ,
26+ } ,
2727} ;
2828
29- const { ThemeProvider, withTheme } = createTheming < Theme > (
30- themes . default
31- ) ;
29+ const { ThemeProvider, withTheme } = createTheming < Theme > ( themes . default ) ;
3230
3331type TitleComponentProps = {
3432 title : string ;
@@ -39,7 +37,7 @@ const TitleComponent = ({ title, theme }: TitleComponentProps) => (
3937 < div
4038 style = { {
4139 backgroundColor : theme . backgroundColor ,
42- color : theme . primaryColor
40+ color : theme . primaryColor ,
4341 } }
4442 >
4543 { title }
@@ -50,7 +48,10 @@ const ThemedTitle = withTheme(TitleComponent);
5048
5149const App = ( ) => (
5250 < ThemeProvider theme = { themes . default } >
53- < ThemedTitle title = "React Theme Provider" theme = { { primaryColor : 'pink' } } />
51+ < ThemedTitle
52+ title = "React Theme Provider"
53+ theme = { { primaryColor : 'pink' } }
54+ />
5455 < ThemedTitle title = "Second title" />
5556 </ ThemeProvider >
5657) ;
0 commit comments