mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-12 08:41:31 -05:00
730835c4be
* 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.
30 lines
747 B
JavaScript
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));
|