scratch-www/src/components/forms/checkbox.jsx
chrisgarrity 730835c4be Fix validation and lint errors
* checkbox needed a default value
* general-error is passed a ref by formsy - cannot be stateless function
* add missing `label` prop to input field
* add missing proptypes to phoneinput.
2018-04-02 12:26:12 -04:00

30 lines
747 B
JavaScript

const classNames = require('classnames');
const FRCCheckbox = require('formsy-react-components').Checkbox;
const PropTypes = require('prop-types');
const React = require('react');
const defaultValidationHOC = require('./validations.jsx').defaultValidationHOC;
const inputHOC = require('./input-hoc.jsx');
require('./row.scss');
require('./checkbox.scss');
const Checkbox = props => (
<FRCCheckbox
rowClassName={classNames('checkbox-row', props.className)}
{...props}
/>
);
Checkbox.propTypes = {
className: PropTypes.string,
value: PropTypes.bool,
valueLabel: PropTypes.string
};
Checkbox.defaultProps = {
value: false,
valueLabel: ''
};
module.exports = inputHOC(defaultValidationHOC(Checkbox));