import React from 'react' import Checkmark from './svg/Checkmark' import { COLORS } from '../lib/constants' class Toggle extends React.PureComponent { static defaultProps = { className: '' } toggle = () => this.props.onChange(!this.props.enabled) handleKeydown = e => { if (e.key === 'Enter') this.toggle() if (e.key === ' ') { e.preventDefault() this.toggle() } } render() { // TODO use input[type=["checkbox"] /> instead of div return (
{this.props.enabled ? :
}
) } } export default Toggle