From 1f8b32ac0e193bf186f3312f38d6ddaba9862519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Mart=C3=ADnez?= Date: Mon, 26 Aug 2019 16:48:25 +0200 Subject: [PATCH] Add textarea component --- src/components/forms/TextField/index.jsx | 4 +++ src/components/forms/TextareaField/index.jsx | 35 ++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/components/forms/TextareaField/index.jsx diff --git a/src/components/forms/TextField/index.jsx b/src/components/forms/TextField/index.jsx index e27ed47b..32fd7861 100644 --- a/src/components/forms/TextField/index.jsx +++ b/src/components/forms/TextField/index.jsx @@ -30,6 +30,8 @@ class TextField extends React.PureComponent { inputAdornment, classes, testId, + rows, + multiline, ...rest } = this.props const helperText = value ? text : undefined @@ -53,6 +55,8 @@ class TextField extends React.PureComponent { onChange={onChange} value={value} // data-testid={testId} + rows={rows} + multiline={multiline} /> ) } diff --git a/src/components/forms/TextareaField/index.jsx b/src/components/forms/TextareaField/index.jsx new file mode 100644 index 00000000..741b793d --- /dev/null +++ b/src/components/forms/TextareaField/index.jsx @@ -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) => ( + +) + +export default withStyles(styles)(TextareaField)