diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/client/common/button.component.js | 36 | ||||
| -rw-r--r-- | app/client/live/index.js | 20 |
2 files changed, 46 insertions, 10 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) diff --git a/app/client/live/index.js b/app/client/live/index.js index 4fc1b5c..3a5dbd4 100644 --- a/app/client/live/index.js +++ b/app/client/live/index.js @@ -64,6 +64,12 @@ class App extends Component { options={['a','b','sequence','recursive']} /> <Select + name='sequence_name' + title='sequence' + options={this.props.sequences} + onChange={this.changeSequence} + /> + <Select name='checkpoint_name' title='checkpoint' options={this.props.checkpoints} @@ -75,22 +81,16 @@ class App extends Component { options={this.props.epochs} onChange={this.changeEpoch} /> - <Select - name='sequence_name' - title='sequence' - options={this.props.sequences} - onChange={this.changeSequence} - /> <Slider name='position' min={0.0} max={1.0} type='float' value={(this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1)} onChange={this.seek} /> - <div> - Processing: {this.props.opt.processing} - </div> - <Button onClick={this.toggle}> + <Button + title={'Processing: ' + (this.props.opt.processing ? 'yes' : 'no')} + onClick={this.toggle} + > {this.props.opt.processing ? 'Pause' : 'Restart'} </Button> </ParamGroup> |
