summaryrefslogtreecommitdiff
path: root/src/containers/app/timeline/PlayButtonContainer.js
blob: 1003b69cd2a8b6a98a93366fa234112b4fb40b0a (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
import {connect} from "react-redux";
import {pauseSimulation, playSimulation} from "../../../actions/simulation/playback";
import PlayButtonComponent from "../../../components/app/timeline/PlayButtonComponent";

const mapStateToProps = state => {
    return {
        isPlaying: state.isPlaying,
        currentTick: state.currentTick,
        lastSimulatedTick: state.lastSimulatedTick,
    };
};

const mapDispatchToProps = dispatch => {
    return {
        onPlay: () => dispatch(playSimulation()),
        onPause: () => dispatch(pauseSimulation()),
    };
};

const PlayButtonContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(PlayButtonComponent);

export default PlayButtonContainer;