Skip to content

Commit 30b4646

Browse files
committed
Update UI of root toggle
1 parent ca0acea commit 30b4646

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

app/src/components/left/ComponentPanel.tsx

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import TextField from '@material-ui/core/TextField';
1010
import Button from '@material-ui/core/Button';
1111
import FormControlLabel from '@material-ui/core/FormControlLabel';
1212
import FormControl from '@material-ui/core/FormControl';
13+
import Checkbox from '@material-ui/core/Checkbox';
1314
import Switch from '@material-ui/core/Switch';
1415
import InputLabel from '@material-ui/core/InputLabel';
1516
import MenuItem from '@material-ui/core/MenuItem';
@@ -22,13 +23,18 @@ const useStyles = makeStyles({
2223
marginTop: '15px'
2324
},
2425
inputWrapper: {
25-
height: '115px',
26+
// height: '115px',
2627
textAlign: 'center',
2728
display: 'flex',
29+
alignItems: 'center',
2830
justifyContent: 'center',
2931
paddingLeft: '35px',
3032
marginBottom: '15px'
3133
},
34+
rootCheckBox: {},
35+
rootCheckBoxLabel: {
36+
color: 'white'
37+
},
3238
projectTypeWrapper: {
3339
paddingLeft: '35px',
3440
marginBottom: '15px'
@@ -77,7 +83,11 @@ const useStyles = makeStyles({
7783
marginLeft: '10px'
7884
},
7985
button: {
80-
fontSize: '1rem'
86+
fontSize: '1rem',
87+
height: '70px',
88+
maginTop: '10px',
89+
border: '1px solid rgba(70,131,83)',
90+
backgroundColor: 'rgba(1,212,109,0.1)'
8191
},
8292
rootToggle: {
8393
color: '#01d46d',
@@ -212,25 +222,21 @@ const ComponentPanel = (): JSX.Element => {
212222
onChange={handleNameInput}
213223
/>
214224
<div className={classes.btnGroup}>
215-
<Button
216-
className={classes.button}
217-
color="primary"
218-
onClick={handleNameSubmit}
219-
>
220-
ADD
221-
</Button>
222225
<FormControlLabel
223-
control={
224-
<Switch
225-
checked={isRoot}
226-
onChange={toggleRootStatus}
227-
color="primary"
228-
/>
229-
}
230-
className={classes.rootToggle}
231-
label="ROOT"
226+
value="top"
227+
control={<Checkbox color="primary" onChange={toggleRootStatus} />}
228+
label={state.projectType === 'Next.js' ? 'Page' : 'Root'}
229+
className={classes.rootCheckBoxLabel}
230+
labelPlacement="top"
232231
/>
233232
</div>
233+
<Button
234+
className={classes.button}
235+
color="primary"
236+
onClick={handleNameSubmit}
237+
>
238+
ADD
239+
</Button>
234240
</div>
235241
<div className={classes.panelWrapperList}>
236242
<h4>{state.projectType === 'Next.js' ? 'Pages' : 'Root components'}</h4>

0 commit comments

Comments
 (0)