summaryrefslogtreecommitdiff
path: root/src/containers/app/timeline/PlayButtonContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/app/timeline/PlayButtonContainer.js')
-rw-r--r--src/containers/app/timeline/PlayButtonContainer.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/containers/app/timeline/PlayButtonContainer.js b/src/containers/app/timeline/PlayButtonContainer.js
new file mode 100644
index 00000000..3db5302c
--- /dev/null
+++ b/src/containers/app/timeline/PlayButtonContainer.js
@@ -0,0 +1,23 @@
+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,
+ };
+};
+
+const mapDispatchToProps = dispatch => {
+ return {
+ onPlay: () => dispatch(playSimulation()),
+ onPause: () => dispatch(pauseSimulation()),
+ };
+};
+
+const PlayButtonContainer = connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(PlayButtonComponent);
+
+export default PlayButtonContainer;