Lamassu admin server initial commit
This commit is contained in:
parent
d083ae5a40
commit
fc1951c4b2
158 changed files with 28462 additions and 1606 deletions
49
new-lamassu-admin/src/components/inputs/base/TextInput.js
Normal file
49
new-lamassu-admin/src/components/inputs/base/TextInput.js
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import React, { memo } from 'react'
|
||||
import TextField from '@material-ui/core/TextField'
|
||||
import InputAdornment from '@material-ui/core/InputAdornment'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
|
||||
import { fontColor, inputFontSize, inputFontSizeLg, inputFontWeight } from '../../../styling/variables'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
inputRoot: {
|
||||
fontSize: inputFontSize,
|
||||
color: fontColor,
|
||||
fontWeight: inputFontWeight
|
||||
},
|
||||
inputRootLg: {
|
||||
fontSize: inputFontSizeLg,
|
||||
color: fontColor,
|
||||
fontWeight: inputFontWeight
|
||||
},
|
||||
labelRoot: {
|
||||
color: fontColor
|
||||
}
|
||||
})
|
||||
|
||||
const TextInput = memo(({ name, onChange, onBlur, value, touched, errors, suffix, large, ...props }) => {
|
||||
const classes = useStyles()
|
||||
|
||||
return (
|
||||
<TextField
|
||||
id={name}
|
||||
onChange={onChange}
|
||||
onBlur={onBlur}
|
||||
error={!!(touched[name] && errors[name])}
|
||||
value={value}
|
||||
classes={{ root: classes.root }}
|
||||
InputProps={{
|
||||
className: large ? classes.inputRootLg : classes.inputRoot,
|
||||
endAdornment: suffix ? (
|
||||
<InputAdornment className={classes.inputRoot} disableTypography position='end'>
|
||||
{suffix}
|
||||
</InputAdornment>
|
||||
) : null
|
||||
}}
|
||||
InputLabelProps={{ className: classes.labelRoot }}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
export default TextInput
|
||||
Loading…
Add table
Add a link
Reference in a new issue