diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-18 16:52:11 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:06:04 +0200 |
| commit | f8f617c97fcb2df3dbefc9527d974151e367cb60 (patch) | |
| tree | f6405aa54f73b66220f36e3a388725f71d023cfb /src/containers/timeline/PlayButtonContainer.js | |
| parent | 9f86ae6de969baa625e3341c796c64f63b5153ce (diff) | |
Implement basic experiment mode with timeline
The timeline doesn't trigger anything yet, but the visual element is in place and connected.
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; |
