summaryrefslogtreecommitdiff
path: root/frontend/src/containers/app/timeline/PlayButtonContainer.js
blob: e332f08b9e4c29503fb12b61919b8a61bdf602ac (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
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