diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 20:34:42 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 20:34:42 +0200 |
| commit | af3bed7b5b1b01531e3bb34c56612c37717e06b7 (patch) | |
| tree | 8e520aa3936a0296041d246bf8cf9a7e8645dc9f /app/client/common/button.component.js | |
| parent | 413dece08acb8d168835b0642bf1bccf85506c95 (diff) | |
pauzejabber
Diffstat (limited to 'app/client/common/button.component.js')
| -rw-r--r-- | app/client/common/button.component.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/client/common/button.component.js b/app/client/common/button.component.js new file mode 100644 index 0000000..746a3f6 --- /dev/null +++ b/app/client/common/button.component.js @@ -0,0 +1,36 @@ +import { h, Component } from 'preact' +import { connect } from 'react-redux' +import { bindActionCreators } from 'redux' +import * as liveActions from '../live/actions' + +class Button extends Component { + constructor(props){ + super(props) + this.handleClick = this.handleClick.bind(this) + } + handleClick(e){ + this.props.onClick && this.props.onClick() + } + render() { + return ( + <div className='button param'> + <label> + <span>{this.props.title}</span> + <button + onClick={this.handleClick} + > + {this.props.children} + </button> + </label> + </div> + ) + } +} + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ +}) + +export default connect(mapStateToProps, mapDispatchToProps)(Button) |
