fix: apply styles

This commit is contained in:
Luis Félix 2019-11-13 17:44:56 +00:00 committed by Josh Harvey
parent 0d9d54efaf
commit 769822fce9
14 changed files with 120 additions and 96 deletions

View file

@ -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>
)}