Refactor display options input to receive column size as a prop

pull/2397/head
Alex P 2017-11-20 14:16:32 -08:00
parent 47b38aecf0
commit 48519c0be8
1 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,14 @@
import React, {PropTypes} from 'react'
const DisplayOptionsInput = ({id, name, value, onChange, labelText}) =>
<div className="form-group col-sm-6">
const DisplayOptionsInput = ({
id,
name,
value,
onChange,
labelText,
colWidth,
}) =>
<div className={`form-group ${colWidth}`}>
<label htmlFor={name}>
{labelText}
</label>
@ -19,6 +26,7 @@ const {func, string} = PropTypes
DisplayOptionsInput.defaultProps = {
value: '',
colWidth: 'col-sm-6',
}
DisplayOptionsInput.propTypes = {
@ -27,6 +35,7 @@ DisplayOptionsInput.propTypes = {
value: string.isRequired,
onChange: func.isRequired,
labelText: string,
colWidth: string,
}
export default DisplayOptionsInput