mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-28 10:25:17 +00:00
Add textarea component
This commit is contained in:
parent
bffabfaee1
commit
1f8b32ac0e
@ -30,6 +30,8 @@ class TextField extends React.PureComponent<TextFieldProps> {
|
|||||||
inputAdornment,
|
inputAdornment,
|
||||||
classes,
|
classes,
|
||||||
testId,
|
testId,
|
||||||
|
rows,
|
||||||
|
multiline,
|
||||||
...rest
|
...rest
|
||||||
} = this.props
|
} = this.props
|
||||||
const helperText = value ? text : undefined
|
const helperText = value ? text : undefined
|
||||||
@ -53,6 +55,8 @@ class TextField extends React.PureComponent<TextFieldProps> {
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
value={value}
|
value={value}
|
||||||
// data-testid={testId}
|
// data-testid={testId}
|
||||||
|
rows={rows}
|
||||||
|
multiline={multiline}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
35
src/components/forms/TextareaField/index.jsx
Normal file
35
src/components/forms/TextareaField/index.jsx
Normal file
@ -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…
x
Reference in New Issue
Block a user