diff options
Diffstat (limited to 'src/containers/timeline/PlayButtonContainer.js')
| -rw-r--r-- | src/containers/timeline/PlayButtonContainer.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/containers/timeline/PlayButtonContainer.js b/src/containers/timeline/PlayButtonContainer.js new file mode 100644 index 00000000..6d4a9f25 --- /dev/null +++ b/src/containers/timeline/PlayButtonContainer.js @@ -0,0 +1,23 @@ +import {connect} from "react-redux"; +import {pauseSimulation, playSimulation} from "../../actions/simulation/playback"; +import PlayButtonComponent from "../../components/timeline/PlayButtonComponent"; + +const mapStateToProps = state => { + return { + isPlaying: state.isPlaying, + }; +}; + +const mapDispatchToProps = dispatch => { + return { + onPlay: () => dispatch(playSimulation()), + onPause: () => dispatch(pauseSimulation()), + }; +}; + +const PlayButtonContainer = connect( + mapStateToProps, + mapDispatchToProps +)(PlayButtonComponent); + +export default PlayButtonContainer; |
