From 8d06839056967e8786c63976545aff098ae2f128 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Jun 2018 01:28:41 +0200 Subject: morph module.. enum method for sliders --- app/client/common/checkbox.component.js | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/client/common/checkbox.component.js (limited to 'app/client/common/checkbox.component.js') diff --git a/app/client/common/checkbox.component.js b/app/client/common/checkbox.component.js new file mode 100644 index 0000000..2d808c2 --- /dev/null +++ b/app/client/common/checkbox.component.js @@ -0,0 +1,41 @@ +import { h, Component } from 'preact' +import { connect } from 'react-redux' +import { bindActionCreators } from 'redux' +import * as liveActions from '../live/live.actions' + +class Checkbox extends Component { + constructor(props){ + super(props) + this.handleClick = this.handleClick.bind(this) + } + handleClick(e){ + clearTimeout(this.timeout) + let new_value = e.target.checked + this.props.onToggle && this.props.onToggle(new_value) + } + render() { + const checked = this.props.value + const dim = !this.props.noDim + return ( +
+ +
+ ) + } +} + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ + // actions: bindActionCreators(liveActions, dispatch) +}) + +export default connect(mapStateToProps, mapDispatchToProps)(Checkbox) -- cgit v1.2.3-70-g09d2