Add textarea component
This commit is contained in:
parent
bffabfaee1
commit
1f8b32ac0e
|
@ -30,6 +30,8 @@ class TextField extends React.PureComponent<TextFieldProps> {
|
|||
inputAdornment,
|
||||
classes,
|
||||
testId,
|
||||
rows,
|
||||
multiline,
|
||||
...rest
|
||||
} = this.props
|
||||
const helperText = value ? text : undefined
|
||||
|
@ -53,6 +55,8 @@ class TextField extends React.PureComponent<TextFieldProps> {
|
|||
onChange={onChange}
|
||||
value={value}
|
||||
// data-testid={testId}
|
||||
rows={rows}
|
||||
multiline={multiline}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
// @flow
|
||||
import React from 'react'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import { TextFieldProps } from '@material-ui/core/TextField'
|
||||
import Field from '~/components/forms/Field'
|
||||
import TextField from '~/components/forms/TextField'
|
||||
|
||||
const styles = () => ({
|
||||
textarea: {
|
||||
'& > div': {
|
||||
height: '140px',
|
||||
paddingTop: '0',
|
||||
paddingBottom: '0',
|
||||
alignItems: 'auto',
|
||||
'& > textarea': {
|
||||
fontSize: '15px',
|
||||
letterSpacing: '-0.5px',
|
||||
lineHeight: '20px',
|
||||
height: '102px',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
const TextareaField = ({ classes, ...props }: TextFieldProps) => (
|
||||
<Field
|
||||
{...props}
|
||||
component={TextField}
|
||||
multiline
|
||||
rows="5"
|
||||
className={classes.textarea}
|
||||
/>
|
||||
)
|
||||
|
||||
export default withStyles(styles)(TextareaField)
|
Loading…
Reference in New Issue