fix: apply styles
This commit is contained in:
parent
0d9d54efaf
commit
769822fce9
14 changed files with 120 additions and 96 deletions
|
|
@ -7,8 +7,11 @@ import {
|
|||
FormControlLabel
|
||||
} from '@material-ui/core'
|
||||
|
||||
import typographyStyles from '../../typography/styles'
|
||||
import { secondaryColor } from '../../../styling/variables'
|
||||
|
||||
const { p } = typographyStyles
|
||||
|
||||
const GreenRadio = withStyles({
|
||||
root: {
|
||||
color: secondaryColor,
|
||||
|
|
@ -19,13 +22,19 @@ const GreenRadio = withStyles({
|
|||
checked: {}
|
||||
})(props => <MaterialRadio color='default' {...props} />)
|
||||
|
||||
const Label = withStyles({
|
||||
label: {
|
||||
extend: p
|
||||
}
|
||||
})(props => <FormControlLabel {...props} />)
|
||||
|
||||
const RadioGroup = ({ name, value, labels, ariaLabel, onChange, className, ...props }) => {
|
||||
return (
|
||||
<>
|
||||
{labels && (
|
||||
<MaterialRadioGroup aria-label={ariaLabel} name={name} value={value} onChange={onChange} className={classnames(className)}>
|
||||
{labels.map((label, idx) => (
|
||||
<FormControlLabel key={idx} value={idx} control={<GreenRadio />} label={label} />
|
||||
<Label key={idx} value={idx} control={<GreenRadio />} label={label} />
|
||||
))}
|
||||
</MaterialRadioGroup>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue