webamp/js/components/ActionButtons.jsx
Jordan Eldredge 2b6b7f30b5 Rename and move files for better clarity (#186)
* Rename and move files for better clarity

* Add sample mp3 file
2016-08-02 10:10:17 -07:00

33 lines
858 B
JavaScript

import React from 'react';
import {connect} from 'react-redux';
import {play, pause, stop} from '../actionCreators';
class ActionButtons extends React.Component {
constructor(props) {
super(props);
this.play = this.play.bind(this);
this.pause = this.pause.bind(this);
this.stop = this.stop.bind(this);
}
play() {
this.props.dispatch(play(this.props.mediaPlayer));
}
pause() {
this.props.dispatch(pause(this.props.mediaPlayer));
}
stop() {
this.props.dispatch(stop(this.props.mediaPlayer));
}
render() {
return <div className='actions'>
<div id='previous' />
<div id='play' onClick={this.play} />
<div id='pause' onClick={this.pause} />
<div id='stop' onClick={this.stop} />
<div id='next' />
</div>;
}
}
module.exports = connect((state) => state.media)(ActionButtons);