From 44cd1990785042cda894256553b52dcb4a58b461 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 18 Feb 2020 14:36:48 -0500 Subject: [PATCH] add text area option to FormField component --- .../src/components/FormField/FormField.jsx | 95 +++++++++++++------ 1 file changed, 65 insertions(+), 30 deletions(-) diff --git a/awx/ui_next/src/components/FormField/FormField.jsx b/awx/ui_next/src/components/FormField/FormField.jsx index b92fee5484..19b1b8a0af 100644 --- a/awx/ui_next/src/components/FormField/FormField.jsx +++ b/awx/ui_next/src/components/FormField/FormField.jsx @@ -1,6 +1,12 @@ import React from 'react'; import PropTypes from 'prop-types'; import { useField } from 'formik'; +import { + FormGroup, + TextInput, + TextArea, + Tooltip, +} from '@patternfly/react-core'; import { QuestionCircleIcon as PFQuestionCircleIcon } from '@patternfly/react-icons'; import styled from 'styled-components'; @@ -17,52 +23,81 @@ function FormField(props) { tooltipMaxWidth, validate, isRequired, + type, ...rest } = props; const [field, meta] = useField({ name, validate }); const isValid = !(meta.touched && meta.error); - return ( - + {(type === 'textarea' && ( + + {tooltip && ( + + + + )} +