summaryrefslogtreecommitdiff
path: root/frontend/src/containers/app/timeline/PlayButtonContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/containers/app/timeline/PlayButtonContainer.js')
-rw-r--r--frontend/src/containers/app/timeline/PlayButtonContainer.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/frontend/src/containers/app/timeline/PlayButtonContainer.js b/frontend/src/containers/app/timeline/PlayButtonContainer.js
new file mode 100644
index 00000000..4e3c3d81
--- /dev/null
+++ b/frontend/src/containers/app/timeline/PlayButtonContainer.js
@@ -0,0 +1,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;