Created
July 12, 2016 13:13
-
-
Save colmtuite/41d8a0a11288a5ff6c64f61565c06443 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import InputField from './InputField.react'; | |
import classNames from 'classnames'; | |
export default function Input(props) { | |
const classes = []; | |
if (props.disabled) classes.push('opacity-30', 'userSelect-none', 'pointerEvents-none'); | |
return ( | |
<div | |
className={classNames(classes, props.className)}> | |
<span className="display-block marginBottom-xxs fontSize-xs c-silver letterSpacing-m userSelect-none"> | |
{props.label} | |
</span> | |
<InputField | |
value={props.value} | |
unit={props.unit} | |
callback={props.callback} | |
minValue={props.minValue} | |
maxValue={props.maxValue} | |
name={props.name} | |
/> | |
</div> | |
); | |
} | |
Input.propTypes = { | |
className: React.PropTypes.string, | |
label: React.PropTypes.string, | |
name: React.PropTypes.string, | |
value: React.PropTypes.any, | |
unit: React.PropTypes.string, | |
callback: React.PropTypes.func, | |
minValue: React.PropTypes.number, | |
maxValue: React.PropTypes.number, | |
disabled: React.PropTypes.bool, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment