diff options
Diffstat (limited to 'web-ui/src/common/input_field/input_field.js')
-rw-r--r-- | web-ui/src/common/input_field/input_field.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index 1378ba74..d4876d9f 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -19,16 +19,24 @@ import React from 'react'; import './input-field.scss'; -const InputField = ({ label, name }) => ( +const InputField = ({ label, name, type = 'text' }) => ( <div className='input-field-group'> - <input type='text' name={name} className='input-field' required /> + <input + type={type} name={name} className='input-field' + autoFocus='' required + /> <label className='input-field-label' htmlFor={name}>{label}</label> </div> ); InputField.propTypes = { label: React.PropTypes.string.isRequired, - name: React.PropTypes.string.isRequired + name: React.PropTypes.string.isRequired, + type: React.PropTypes.string +}; + +InputField.defaultProps = { + type: 'text' }; export default InputField; |