Skip to content

Commit 801421c

Browse files
committed
finished darkmode
Co-authored-by: Philip Hua <[email protected]> Co-authored-by: Miles Wright <[email protected]> Co-authored-by: William Rittwage <[email protected]> Co-authored-by: Daniel Reilley <[email protected]>
1 parent 6875668 commit 801421c

File tree

6 files changed

+59
-20
lines changed

6 files changed

+59
-20
lines changed

app/src/components/left/HTMLPanel.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,16 @@ const useStyles = makeStyles({
271271
borderRadius: '4px',
272272
},
273273
lightThemeFontColor: {
274-
color: '#155084'
274+
color: '#155084',
275+
'& .MuiInputBase-root': {
276+
color: 'rgba (0, 0, 0, 0.54)',
277+
}
275278
},
276279
darkThemeFontColor: {
277-
color: '#ffffff'
280+
color: '#ffffff',
281+
'& .MuiInputBase-root': {
282+
color: '#fff',
283+
}
278284
},
279285
errorMessage: {
280286
fontSize:"11px",

app/src/components/right/ComponentDrag.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const ComponentDrag = ({isThemeLight}): JSX.Element => {
3434
name={comp.name}
3535
id={comp.id}
3636
root={true}
37+
isThemeLight={isThemeLight}
3738
/>
3839

3940
);

app/src/components/right/ComponentPanel.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,16 @@ const useStyles = makeStyles({
261261
fontSize: '0.85rem'
262262
},
263263
lightThemeFontColor: {
264-
color: '#155084'
264+
color: '#155084',
265+
'& .MuiInputBase-root': {
266+
color: 'rgba (0, 0, 0, 0.54)',
267+
}
265268
},
266269
darkThemeFontColor: {
267-
color: '#fff'
270+
color: '#fff',
271+
'& .MuiInputBase-root': {
272+
color: '#fff',
273+
}
268274
}
269275
});
270276

app/src/components/right/ComponentPanelItem.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const ComponentPanelItem: React.FC<{
4141
id: number;
4242
root: boolean;
4343
isFocus: boolean;
44-
}> = ({ name, id, root, isFocus }) => {
44+
isThemeLight: boolean;
45+
}> = ({ name, id, root, isFocus, isThemeLight }) => {
4546
const classes = useStyles();
4647
const [state, dispatch] = useContext(StateContext);
4748

@@ -66,15 +67,15 @@ const ComponentPanelItem: React.FC<{
6667
payload: { componentId: id, childId: null }
6768
});
6869
};
70+
console.log('isThemeLight 3:',isThemeLight)
6971
return (
7072
<Grid
7173
item
7274
ref={drag}
7375
xs={8}
7476
style={{
7577
display: 'grid',
76-
color: '#262626',
77-
display: 'grid',
78+
color: isThemeLight ? 'black' : 'white',
7879
backgroundColor: 'transparent',
7980
border: root
8081
? '2px dotted #186BB4'
@@ -86,7 +87,7 @@ const ComponentPanelItem: React.FC<{
8687
>
8788
{isFocus && <div className={classes.focusMark}></div>}
8889
<div className="compPanelItem" onClick={handleClick}>
89-
<h3 >{name}</h3>
90+
<h3>{name}</h3>
9091
</div>
9192
</Grid>
9293
);
@@ -102,6 +103,12 @@ const useStyles = makeStyles({
102103
width: '12px',
103104
height: '12px',
104105
borderRadius: '25px',
106+
},
107+
lightTheme: {
108+
color: 'rgba (0, 0, 0, 0.54)'
109+
},
110+
darkTheme: {
111+
color: '#fff'
105112
}
106113
});
107114

app/src/components/right/StatePropsPanel.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ const StatePropsPanel = ({ isThemeLight }): JSX.Element => {
130130
variant="outlined"
131131
value={inputKey}
132132
onChange={(e) => setInputKey(e.target.value)}
133-
className={isThemeLight ? classes.rootLight : classes.rootDark}
133+
className={isThemeLight ? `${classes.rootLight} ${classes.inputTextLight}` : `${classes.rootDark} ${classes.inputTextDark}`}
134134
/>
135135
<TextField
136136
id="textfield-value"
137-
className={isThemeLight ? classes.rootLight : classes.rootDark}
138137
label="value:"
139138
variant="outlined"
140139
value={inputValue}
141140
onChange={(e) => setInputValue(e.target.value)}
141+
className={isThemeLight ? `${classes.rootLight} ${classes.inputTextLight}` : `${classes.rootDark} ${classes.inputTextDark}`}
142142
/>
143143
<FormControl required className={isThemeLight ? `${classes.formControl} ${classes.lightThemeFontColor}` : `${classes.formControl} ${classes.darkThemeFontColor}`}>
144144
<InputLabel
@@ -149,7 +149,7 @@ const StatePropsPanel = ({ isThemeLight }): JSX.Element => {
149149
<Select
150150
labelId="select-required-label"
151151
id="type-input"
152-
className={isThemeLight ? `${classes.selectEmpty} ${classes.rootUnderlineLight}` : `${classes.selectEmpty} ${classes.rootUnderlineDark}`}
152+
className={isThemeLight ? `${classes.selectEmpty} ${classes.rootUnderlineLight} ${classes.inputTextLight}` : `${classes.selectEmpty} ${classes.rootUnderlineDark} ${classes.inputTextDark}`}
153153
value={inputType}
154154
onChange={(event, index) => setInputType(index.props.value)}
155155
>
@@ -351,6 +351,16 @@ const useStyles = makeStyles((theme: Theme) =>
351351
borderBottom: '1px solid rgba(0,0,0,0.54)'
352352
}
353353
// }
354+
},
355+
inputTextDark: {
356+
'& .MuiInputBase-input': {
357+
color: 'white'
358+
}
359+
},
360+
inputTextLight: {
361+
'& .MuiInputBase-input': {
362+
color: 'rgba(0,0,0,0.54)'
363+
}
354364
}
355365
})
356366
);

app/src/components/right/TableStateProps.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,30 @@ const getColumns = (props) => {
1818
{
1919
field: 'id',
2020
headerName: 'ID',
21-
headerClassName: props.isThemeLight ? 'classes.themeLight' : 'classes.themeDark',
2221
width: 70,
2322
editable: false,
2423
},
2524
{
2625
field: 'key',
2726
headerName: 'Key',
28-
headerClassName: props.isThemeLight ? 'classes.themeLight' : 'classes.themeDark',
2927
width: 90,
3028
editable: true,
3129
},
3230
{
3331
field: 'value',
3432
headerName: 'Value',
35-
headerClassName: props.isThemeLight ? 'classes.themeLight' : 'classes.themeDark',
3633
width: 90,
3734
editable: true,
3835
},
3936
{
4037
field: 'type',
4138
headerName: 'Type',
42-
headerClassName: props.isThemeLight ? 'classes.themeLight' : 'classes.themeDark',
4339
width: 90,
4440
editable: false,
4541
},
4642
{
4743
field: 'delete',
4844
headerName: 'X',
49-
headerClassName: props.isThemeLight ? 'classes.themeLight' : 'classes.themeDark',
5045
width: 70,
5146
editable: false,
5247
renderCell: function renderCell(params:any) {
@@ -100,8 +95,7 @@ const TableStateProps = (props) => {
10095
pageSize={5}
10196
editRowsModel={editRowsModel}
10297
onRowClick = {selectHandler}
103-
headerClassName: props.isThemeLight ? 'classes.themeLight' : 'classes.themeDark',
104-
98+
className={props.isThemeLight ? classes.themeLight : classes.themeDark}
10599
/>
106100
</div>
107101
);
@@ -110,10 +104,25 @@ const TableStateProps = (props) => {
110104

111105
const useStyles = makeStyles({
112106
themeLight: {
113-
color: 'rbga(0,0,0,054)'
107+
color: 'rgba(0,0,0,0.54)',
108+
'& .MuiTablePagination-root': {
109+
color: 'rbga(0,0,0,0.54)'
110+
},
114111
},
115112
themeDark: {
116-
color: 'white'
113+
color: 'white',
114+
'& .MuiTablePagination-root': {
115+
color: 'white'
116+
},
117+
'& .MuiIconButton-root': {
118+
color: 'white'
119+
},
120+
'& .MuiSvgIcon-root': {
121+
color: 'white'
122+
},
123+
'& .MuiDataGrid-window': {
124+
backgroundColor: 'rgba(0,0,0,0.54)'
125+
}
117126
}
118127
});
119128

0 commit comments

Comments
 (0)