Skip to content

Instantly share code, notes, and snippets.

@ALF-er
Created February 22, 2016 14:33
Show Gist options
  • Save ALF-er/f044d9ce1cc84146ad53 to your computer and use it in GitHub Desktop.
Save ALF-er/f044d9ce1cc84146ad53 to your computer and use it in GitHub Desktop.
import React, { PropTypes } from "react";
import cx from "classnames";
import { getComponentClassName } from "utils/ComponentsUtils";
import "./UnverifiedDataToggle.scss";
const UnverifiedDataToggle = ({ className, value, onChange }) => {
const ccn = getComponentClassName("unverified-data-toggle");
return (
<label className={cx(ccn(), value && ccn("--selected"), className)}>
<input
type="checkbox"
className={ccn("checkbox")}
checked={value}
onChange={onChange}
/>
Include unverified data
</label>
);
};
UnverifiedDataToggle.propTypes = {
className: PropTypes.string,
value: PropTypes.bool,
onChange: PropTypes.func
};
UnverifiedDataToggle.defaultProps = {
value: false,
onChange: _.noop
};
export default UnverifiedDataToggle;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment