diff options
Diffstat (limited to 'src/containers/app/timeline')
4 files changed, 77 insertions, 71 deletions
diff --git a/src/containers/app/timeline/PlayButtonContainer.js b/src/containers/app/timeline/PlayButtonContainer.js index 1003b69c..4e3c3d81 100644 --- a/src/containers/app/timeline/PlayButtonContainer.js +++ b/src/containers/app/timeline/PlayButtonContainer.js @@ -1,25 +1,27 @@ -import {connect} from "react-redux"; -import {pauseSimulation, playSimulation} from "../../../actions/simulation/playback"; +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, - }; + return { + isPlaying: state.isPlaying, + currentTick: state.currentTick, + lastSimulatedTick: state.lastSimulatedTick + }; }; const mapDispatchToProps = dispatch => { - return { - onPlay: () => dispatch(playSimulation()), - onPause: () => dispatch(pauseSimulation()), - }; + return { + onPlay: () => dispatch(playSimulation()), + onPause: () => dispatch(pauseSimulation()) + }; }; -const PlayButtonContainer = connect( - mapStateToProps, - mapDispatchToProps -)(PlayButtonComponent); +const PlayButtonContainer = connect(mapStateToProps, mapDispatchToProps)( + PlayButtonComponent +); export default PlayButtonContainer; diff --git a/src/containers/app/timeline/TimelineContainer.js b/src/containers/app/timeline/TimelineContainer.js index 46491f9b..74d37d58 100644 --- a/src/containers/app/timeline/TimelineContainer.js +++ b/src/containers/app/timeline/TimelineContainer.js @@ -1,39 +1,41 @@ -import {connect} from "react-redux"; -import {pauseSimulation} from "../../../actions/simulation/playback"; -import {incrementTick} from "../../../actions/simulation/tick"; -import {setCurrentDatacenter} from "../../../actions/topology/building"; +import { connect } from "react-redux"; +import { pauseSimulation } from "../../../actions/simulation/playback"; +import { incrementTick } from "../../../actions/simulation/tick"; +import { setCurrentDatacenter } from "../../../actions/topology/building"; import TimelineComponent from "../../../components/app/timeline/TimelineComponent"; const mapStateToProps = state => { - let sections = []; - if (state.currentExperimentId !== -1) { - const sectionIds = state.objects.path[state.objects.experiment[state.currentExperimentId].pathId].sectionIds; + let sections = []; + if (state.currentExperimentId !== -1) { + const sectionIds = + state.objects.path[ + state.objects.experiment[state.currentExperimentId].pathId + ].sectionIds; - if (sectionIds) { - sections = sectionIds.map(sectionId => state.objects.section[sectionId]); - } + if (sectionIds) { + sections = sectionIds.map(sectionId => state.objects.section[sectionId]); } + } - return { - isPlaying: state.isPlaying, - currentTick: state.currentTick, - lastSimulatedTick: state.lastSimulatedTick, - currentDatacenterId: state.currentDatacenterId, - sections, - }; + return { + isPlaying: state.isPlaying, + currentTick: state.currentTick, + lastSimulatedTick: state.lastSimulatedTick, + currentDatacenterId: state.currentDatacenterId, + sections + }; }; const mapDispatchToProps = dispatch => { - return { - incrementTick: () => dispatch(incrementTick()), - pauseSimulation: () => dispatch(pauseSimulation()), - setCurrentDatacenter: id => dispatch(setCurrentDatacenter(id)) - }; + return { + incrementTick: () => dispatch(incrementTick()), + pauseSimulation: () => dispatch(pauseSimulation()), + setCurrentDatacenter: id => dispatch(setCurrentDatacenter(id)) + }; }; -const TimelineContainer = connect( - mapStateToProps, - mapDispatchToProps -)(TimelineComponent); +const TimelineContainer = connect(mapStateToProps, mapDispatchToProps)( + TimelineComponent +); export default TimelineContainer; diff --git a/src/containers/app/timeline/TimelineControlsContainer.js b/src/containers/app/timeline/TimelineControlsContainer.js index e91a0aca..ac851b2e 100644 --- a/src/containers/app/timeline/TimelineControlsContainer.js +++ b/src/containers/app/timeline/TimelineControlsContainer.js @@ -1,34 +1,36 @@ -import {connect} from "react-redux"; -import {goToTick} from "../../../actions/simulation/tick"; +import { connect } from "react-redux"; +import { goToTick } from "../../../actions/simulation/tick"; import TimelineControlsComponent from "../../../components/app/timeline/TimelineControlsComponent"; const mapStateToProps = state => { - let sectionTicks = []; - if (state.currentExperimentId !== -1) { - const sectionIds = state.objects.path[state.objects.experiment[state.currentExperimentId].pathId].sectionIds; - if (sectionIds) { - sectionTicks = sectionIds - .filter(sectionId => state.objects.section[sectionId].startTick !== 0) - .map(sectionId => state.objects.section[sectionId].startTick); - } + let sectionTicks = []; + if (state.currentExperimentId !== -1) { + const sectionIds = + state.objects.path[ + state.objects.experiment[state.currentExperimentId].pathId + ].sectionIds; + if (sectionIds) { + sectionTicks = sectionIds + .filter(sectionId => state.objects.section[sectionId].startTick !== 0) + .map(sectionId => state.objects.section[sectionId].startTick); } + } - return { - currentTick: state.currentTick, - lastSimulatedTick: state.lastSimulatedTick, - sectionTicks, - }; + return { + currentTick: state.currentTick, + lastSimulatedTick: state.lastSimulatedTick, + sectionTicks + }; }; const mapDispatchToProps = dispatch => { - return { - goToTick: (tick) => dispatch(goToTick(tick)), - }; + return { + goToTick: tick => dispatch(goToTick(tick)) + }; }; -const TimelineControlsContainer = connect( - mapStateToProps, - mapDispatchToProps -)(TimelineControlsComponent); +const TimelineControlsContainer = connect(mapStateToProps, mapDispatchToProps)( + TimelineControlsComponent +); export default TimelineControlsContainer; diff --git a/src/containers/app/timeline/TimelineLabelsContainer.js b/src/containers/app/timeline/TimelineLabelsContainer.js index 3dfad9f2..9d7f268d 100644 --- a/src/containers/app/timeline/TimelineLabelsContainer.js +++ b/src/containers/app/timeline/TimelineLabelsContainer.js @@ -1,15 +1,15 @@ -import {connect} from "react-redux"; +import { connect } from "react-redux"; import TimelineLabelsComponent from "../../../components/app/timeline/TimelineLabelsComponent"; const mapStateToProps = state => { - return { - currentTick: state.currentTick, - lastSimulatedTick: state.lastSimulatedTick, - }; + return { + currentTick: state.currentTick, + lastSimulatedTick: state.lastSimulatedTick + }; }; -const TimelineLabelsContainer = connect( - mapStateToProps -)(TimelineLabelsComponent); +const TimelineLabelsContainer = connect(mapStateToProps)( + TimelineLabelsComponent +); export default TimelineLabelsContainer; |
