Checkbox.js 454 B

12345678910
  1. import React, { Component } from 'react'
  2. import '../css/Checkbox.scss'
  3. class Checkbox extends Component {
  4. render() {
  5. return <div className={ `checkbox${ this.props.checked ? ' checked' : '' }${ this.props.indeterminate ? ' indeterminate' : '' }${ this.props.disabled ? ' disabled' : '' }` } onClick={ (e) => { e.preventDefault(); e.stopPropagation(); if(!this.props.disabled) this.props.onChange() } }></div>
  6. }
  7. }
  8. export default Checkbox