|
1 | 1 | import React, { Component } from 'react';
|
2 | 2 | import './App.css';
|
3 |
| -import { TextInput } from './utils/form_helpers'; |
| 3 | +import { TextInput, TextArea } from './utils/form_helpers'; |
4 | 4 | import Validation, { Validate } from './utils/form_helpers/Validation';
|
5 | 5 | import { inputType } from './utils/Constants';
|
6 | 6 | import { onChangeHandler } from './utils/form_helpers/FormMethods';
|
@@ -74,6 +74,20 @@ class App extends Component {
|
74 | 74 | message: "Password is required"
|
75 | 75 | }
|
76 | 76 | ]
|
| 77 | +}, |
| 78 | +summary: { |
| 79 | +value: '', |
| 80 | +placeholder: 'Enter summary', |
| 81 | +rows: 5, |
| 82 | +valid: false, |
| 83 | +touched: false, |
| 84 | +errorMessage: "", |
| 85 | +validationRules: [ |
| 86 | +{ |
| 87 | +validate: Validation.isRequired, |
| 88 | +message: "Summary is required" |
| 89 | +} |
| 90 | +] |
77 | 91 | }
|
78 | 92 | }
|
79 | 93 | }
|
@@ -135,6 +149,19 @@ class App extends Component {
|
135 | 149 | touched={this.state.formControls.password.touched}
|
136 | 150 | valid={this.state.formControls.password.valid}
|
137 | 151 | />
|
| 152 | + |
| 153 | +<TextArea |
| 154 | +label="Summary" |
| 155 | +name="summary" |
| 156 | +placeholder={this.state.formControls.summary.placeholder} |
| 157 | +// helpText="summary" |
| 158 | +errorMessage={this.state.formControls.summary.errorMessage} |
| 159 | +value={this.state.formControls.summary.value} |
| 160 | +rows={this.state.formControls.summary.rows} |
| 161 | +onChange={onChangeHandler(this)} |
| 162 | +touched={this.state.formControls.summary.touched} |
| 163 | +valid={this.state.formControls.summary.valid} |
| 164 | +/> |
138 | 165 | <button type="submit" className="btn-submit" disabled={!this.state.formIsValid}> Submit </button>
|
139 | 166 | </form>
|
140 | 167 | </div>
|
|
0 commit comments