feat: add operator info page
feat: save/load operator info feat: add formik switch component feat: add input validation fix: correct formik switch behaviour fix: change infoCardEnabled to a radio input style: move styles out of js feat: add error feedback
This commit is contained in:
parent
b9d2341cd1
commit
7b59e36cb4
10 changed files with 516 additions and 18 deletions
42
new-lamassu-admin/src/components/inputs/formik/RadioGroup.js
Normal file
42
new-lamassu-admin/src/components/inputs/formik/RadioGroup.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import React, { memo } from 'react'
|
||||
import { makeStyles } from '@material-ui/core'
|
||||
|
||||
import { Label1 } from 'src/components/typography'
|
||||
|
||||
import { RadioGroup } from '../base'
|
||||
|
||||
const styles = {
|
||||
label: {
|
||||
height: 16,
|
||||
lineHeight: '16px',
|
||||
margin: [[0, 0, 4, 0]]
|
||||
}
|
||||
}
|
||||
|
||||
const useStyles = makeStyles(styles)
|
||||
|
||||
const RadioGroupFormik = memo(({ ...props }) => {
|
||||
const classes = useStyles()
|
||||
|
||||
const { name, onChange, value } = props.field
|
||||
|
||||
return (
|
||||
<>
|
||||
{props.label && <Label1 className={classes.label}>{props.label}</Label1>}
|
||||
<RadioGroup
|
||||
name={name}
|
||||
value={value}
|
||||
options={props.options}
|
||||
ariaLabel={name}
|
||||
onChange={e => {
|
||||
onChange(e)
|
||||
props.resetError()
|
||||
}}
|
||||
className={props.className}
|
||||
{...props}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
})
|
||||
|
||||
export default RadioGroupFormik
|
||||
Loading…
Add table
Add a link
Reference in a new issue