55 makeStyles ,
66 styled ,
77 Theme ,
8+ createTheme ,
9+ ThemeProvider ,
10+ withStyles
811} from "@material-ui/core/styles" ;
912import Button from "@material-ui/core/Button" ;
1013import {
@@ -24,6 +27,7 @@ import {
2427import StateContext from "../../context/context" ;
2528import TableStateProps from "./TableStateProps" ;
2629
30+
2731const StatePropsPanel = ( { isThemeLight } ) : JSX . Element => {
2832 const classes = useStyles ( ) ;
2933 const [ state ] = useContext ( StateContext ) ;
@@ -119,27 +123,33 @@ const StatePropsPanel = ({ isThemeLight }): JSX.Element => {
119123 < div className = { 'state-panel' } >
120124 < div >
121125 < FormControl >
122- < h4 > Create New State</ h4 >
126+ < h4 className = { isThemeLight ? classes . lightThemeFontColor : classes . darkThemeFontColor } > Create New State</ h4 >
123127 < TextField
124128 id = "textfield-key"
125129 label = "key:"
126130 variant = "outlined"
127131 value = { inputKey }
128132 onChange = { ( e ) => setInputKey ( e . target . value ) }
129- />
133+ className = { isThemeLight ? `${ classes . rootLight } ${ classes . inputTextLight } ` : `${ classes . rootDark } ${ classes . inputTextDark } ` }
134+ />
130135 < TextField
131136 id = "textfield-value"
132137 label = "value:"
133138 variant = "outlined"
134139 value = { inputValue }
135140 onChange = { ( e ) => setInputValue ( e . target . value ) }
136- />
137- < FormControl required className = { classes . formControl } >
138- < InputLabel id = "select-required-label" > Type</ InputLabel >
141+ className = { isThemeLight ? `${ classes . rootLight } ${ classes . inputTextLight } ` : `${ classes . rootDark } ${ classes . inputTextDark } ` }
142+ />
143+ < FormControl required className = { isThemeLight ? `${ classes . formControl } ${ classes . lightThemeFontColor } ` : `${ classes . formControl } ${ classes . darkThemeFontColor } ` } >
144+ < InputLabel
145+ id = "select-required-label"
146+ className = { isThemeLight ? classes . greyThemeFontColor : classes . darkThemeFontColor } >
147+ Type
148+ </ InputLabel >
139149 < Select
140150 labelId = "select-required-label"
141151 id = "type-input"
142- className = { classes . selectEmpty }
152+ className = { isThemeLight ? ` ${ classes . selectEmpty } ${ classes . rootUnderlineLight } ${ classes . inputTextLight } ` : ` ${ classes . selectEmpty } ${ classes . rootUnderlineDark } ${ classes . inputTextDark } ` }
143153 value = { inputType }
144154 onChange = { ( event , index ) => setInputType ( index . props . value ) }
145155 >
@@ -165,7 +175,10 @@ const StatePropsPanel = ({ isThemeLight }): JSX.Element => {
165175 Any
166176 </ MenuItem >
167177 </ Select >
168- < FormHelperText > Required</ FormHelperText >
178+ < FormHelperText
179+ className = { isThemeLight ? classes . greyThemeFontColor : classes . darkThemeFontColor } >
180+ Required
181+ </ FormHelperText >
169182 </ FormControl >
170183 < br > </ br >
171184 < MyButton
@@ -180,15 +193,17 @@ const StatePropsPanel = ({ isThemeLight }): JSX.Element => {
180193 </ div >
181194 < br > </ br >
182195 < div >
183- < h4 > Current State Name: { state . components [ state . canvasFocus . componentId - 1 ] . name } </ h4 >
184- < TableStateProps selectHandler = { handlerRowSelect } deleteHandler = { handlerRowDelete } />
196+ < h4 className = { isThemeLight ? classes . lightThemeFontColor : classes . darkThemeFontColor } >
197+ Current State Name: { state . components [ state . canvasFocus . componentId - 1 ] . name }
198+ </ h4 >
199+ < TableStateProps selectHandler = { handlerRowSelect } deleteHandler = { handlerRowDelete } isThemeLight = { isThemeLight } />
185200 </ div >
186201 </ div >
187202 ) ;
188203} ;
189204
190205const useStyles = makeStyles ( ( theme : Theme ) =>
191- createStyles ( {
206+ ( {
192207 inputField : {
193208 marginTop : "10px" ,
194209 borderRadius : "5px" ,
@@ -287,13 +302,61 @@ const useStyles = makeStyles((theme: Theme) =>
287302 darkThemeFontColor : {
288303 color : "#fff" ,
289304 } ,
305+ greyThemeFontColor : {
306+ color : 'rgba(0,0,0,0.54)' ,
307+ } ,
290308 formControl : {
291309 margin : theme . spacing ( 1 ) ,
292310 minWidth : 120 ,
293311 } ,
294312 selectEmpty : {
295313 marginTop : theme . spacing ( 2 ) ,
296314 } ,
315+ color : {
316+ color : '#fff' ,
317+ } ,
318+ rootLight : {
319+ '& .MuiFormLabel-root' : {
320+ color : 'rgba(0,0,0,0.54)'
321+ }
322+ } ,
323+ rootDark : {
324+ '& .MuiFormLabel-root' : {
325+ color : '#fff'
326+ } ,
327+ '& .MuiOutlinedInput-notchedOutline' : {
328+ borderColor : '#fff'
329+ }
330+ } ,
331+ underlineDark : {
332+ borderBottom : '1px solid white'
333+ } ,
334+ rootUnderlineDark : {
335+ '& .MuiSelect-icon' : {
336+ color : '#fff' ,
337+ } ,
338+ '&::before' : {
339+ borderBottom : '1px solid #fff'
340+ }
341+ } ,
342+ rootUnderlineLight : {
343+ '& .MuiSelect-icon' : {
344+ color : 'rgba(0,0,0,0.54)' ,
345+ } ,
346+ '&::before' : {
347+ borderBottom : '1px solid rgba(0,0,0,0.54)'
348+ }
349+ } ,
350+ inputTextDark : {
351+ '& .MuiInputBase-input' : {
352+ color : 'white'
353+ }
354+ } ,
355+ inputTextLight : {
356+ '& .MuiInputBase-input' : {
357+ color : 'rgba(0,0,0,0.54)'
358+ }
359+ }
297360 } )
298361) ;
299362
@@ -308,4 +371,5 @@ const MyButton = styled(Button)({
308371 padding : "0 30px" ,
309372} ) ;
310373
374+
311375export default StatePropsPanel ;
0 commit comments