-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] Changes in L0S1 after ux frames update, added LO.1, added Switc…
…h component
- Loading branch information
Showing
21 changed files
with
645 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useState } from 'react'; | ||
import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||
import { Switch, Box, FormGroup, makeStyles } from '@material-ui/core/'; | ||
|
||
|
||
const useStyle = makeStyles({ | ||
root: { | ||
justifyContent: 'space-between' | ||
} | ||
}); | ||
|
||
export default ({ options, register }) => { | ||
const classes = useStyle(); | ||
const defaultCheked = {}; | ||
options.map(item => Object.assign(defaultCheked, { [item.name]: true })); | ||
const [checked, setChecked] = useState(defaultCheked); | ||
const handleChange = event => { | ||
setChecked({ ...checked, [event.target.name]: !checked[event.target.name] }); | ||
}; | ||
|
||
return ( | ||
<FormGroup> | ||
{ | ||
options.map(question => { | ||
const { name, label } = question; | ||
return (<FormControlLabel | ||
className={classes.root} | ||
control={ | ||
<Switch | ||
checked={checked[name]} | ||
onChange={handleChange} | ||
name={name} | ||
color="primary" | ||
inputRef={register} | ||
/> | ||
} | ||
label={label} | ||
labelPlacement="start" | ||
/>); | ||
}) | ||
} | ||
</FormGroup> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/styles'; | ||
import { AppBar, Toolbar } from '@material-ui/core'; | ||
import Box from '@material-ui/core/Box'; | ||
import DitoLogo from '../../resources/img/dito.png'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
spacer: { | ||
flex: 1 | ||
}, | ||
root: { | ||
backgroundColor: '#9FC9D9', | ||
marginBottom: theme.spacing(4) | ||
} | ||
})); | ||
|
||
export default () => { | ||
const classes = useStyles(); | ||
return ( | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
<> | ||
<AppBar className={classes.root} position="sticky"> | ||
<Toolbar> | ||
<span className={classes.spacer} /> | ||
<Box p={1}> | ||
<img height="50" src={DitoLogo} alt="logo" /> | ||
</Box> | ||
<span className={classes.spacer} /> | ||
</Toolbar> | ||
</AppBar> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.