summaryrefslogtreecommitdiff
path: root/app/client/common/button.component.js
blob: 21aa5b65891b4cd8b43973519cc877c815b47b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { h, Component } from 'preact'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import * as liveActions from '../live/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)