feat: add date range download dialog

This commit is contained in:
Luis Félix 2019-11-07 12:59:37 +00:00 committed by Josh Harvey
parent 74d592d892
commit 57c0b7cca1
14 changed files with 696 additions and 62 deletions

View file

@ -0,0 +1,32 @@
import React from 'react'
import classnames from 'classnames'
import { withStyles } from '@material-ui/styles'
import FormControlLabel from '@material-ui/core/FormControlLabel'
import { Radio as MaterialRadio, RadioGroup as MaterialRadioGroup } from '@material-ui/core'
import { secondaryColor } from '../../../styling/variables'
const GreenRadio = withStyles({
root: {
color: secondaryColor,
'&$checked': {
color: secondaryColor
}
},
checked: {}
})(props => <MaterialRadio color='default' {...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} />
))}
</MaterialRadioGroup>
)}
</>
)
}
export default RadioGroup