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
41
new-lamassu-admin/src/components/ErrorMessage.js
Normal file
41
new-lamassu-admin/src/components/ErrorMessage.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import React from 'react'
|
||||
import classnames from 'classnames'
|
||||
import { makeStyles } from '@material-ui/core'
|
||||
|
||||
import { ReactComponent as ErrorIcon } from 'src/styling/icons/warning-icon/tomato.svg'
|
||||
import { errorColor } from 'src/styling/variables'
|
||||
|
||||
import { Info3 } from './typography'
|
||||
|
||||
const styles = {
|
||||
wrapper: {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
'& > svg': {
|
||||
marginRight: 10
|
||||
}
|
||||
},
|
||||
message: {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
color: errorColor,
|
||||
margin: 0,
|
||||
whiteSpace: 'break-spaces',
|
||||
width: 250
|
||||
}
|
||||
}
|
||||
|
||||
const useStyles = makeStyles(styles)
|
||||
|
||||
const ErrorMessage = ({ className, children, ...props }) => {
|
||||
const classes = useStyles()
|
||||
|
||||
return (
|
||||
<div className={classnames(classes.wrapper, className)}>
|
||||
<ErrorIcon />
|
||||
<Info3 className={classes.message}>{children}</Info3>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ErrorMessage
|
||||
Loading…
Add table
Add a link
Reference in a new issue