import React from 'react'; /* BEGIN CheckBox: styled checkbox */ export default class CheckBox extends React.PureComponent { constructor(props) { super(props); this.handleChange = this.handleChange.bind(this); } handleChange() { this.props.onChange(this.props.name, !this.props.checked); } render() { return ( this.props.onChange ? ( this.props.checked === true ? check_box : this.props.checked === false ? check_box_outline_blank : indeterminate_check_box ) : ( this.props.checked ? check_box : check_box_outline_blank ) ); } } /* END CheckBox */