From 4ce5ba6c1af5e88b25bd763a9c15616ff69ebbf6 Mon Sep 17 00:00:00 2001 From: Mary Kate Date: Tue, 28 Jul 2020 21:19:11 -0500 Subject: [PATCH] textarea input --- app/soapbox/features/forms/index.js | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/app/soapbox/features/forms/index.js b/app/soapbox/features/forms/index.js index 75feac6d4..24857c33f 100644 --- a/app/soapbox/features/forms/index.js +++ b/app/soapbox/features/forms/index.js @@ -68,6 +68,17 @@ LabelInput.propTypes = { dispatch: PropTypes.func, }; +export const LabelTextarea = ({ label, dispatch, ...props }) => ( + + + +); + +LabelTextarea.propTypes = { + label: FormPropTypes.label.isRequired, + dispatch: PropTypes.func, +}; + export class SimpleInput extends ImmutablePureComponent { static propTypes = { @@ -88,6 +99,26 @@ export class SimpleInput extends ImmutablePureComponent { } +export class SimpleTextarea extends ImmutablePureComponent { + + static propTypes = { + label: FormPropTypes.label, + hint: PropTypes.node, + } + + render() { + const { hint, ...props } = this.props; + const Input = this.props.label ? LabelTextarea : 'textarea'; + + return ( + + + + ); + } + +} + export class SimpleForm extends ImmutablePureComponent { static propTypes = {