webamp/js/Shuffle.jsx
2016-07-26 17:37:25 -07:00

22 lines
484 B
JavaScript

import React from 'react';
import {connect} from 'react-redux';
class Shuffle extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.props.dispatch({type: 'TOGGLE_SHUFFLE'});
}
render() {
return <div
id='shuffle'
className={this.props.shuffle ? 'selected' : ''}
onClick={this.handleClick}
/>;
}
}
module.exports = connect(state => state.media)(Shuffle);