Refactor display options input to receive column size as a prop
parent
47b38aecf0
commit
48519c0be8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue