From 19f1e6db285d0bb8a96d2cea9c7f3a543692b81a Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 21 Sep 2017 16:07:12 +0200 Subject: Hide all construction elements in simulation --- src/containers/sidebars/topology/rack/EmptySlotContainer.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/containers/sidebars/topology/rack/EmptySlotContainer.js') diff --git a/src/containers/sidebars/topology/rack/EmptySlotContainer.js b/src/containers/sidebars/topology/rack/EmptySlotContainer.js index 97abf473..aa0673d1 100644 --- a/src/containers/sidebars/topology/rack/EmptySlotContainer.js +++ b/src/containers/sidebars/topology/rack/EmptySlotContainer.js @@ -2,6 +2,12 @@ import {connect} from "react-redux"; import {addMachine} from "../../../../actions/topology/rack"; import EmptySlotComponent from "../../../../components/sidebars/topology/rack/EmptySlotComponent"; +const mapStateToProps = state => { + return { + inSimulation: state.currentExperimentId !== -1 + }; +}; + const mapDispatchToProps = (dispatch, ownProps) => { return { onAdd: () => dispatch(addMachine(ownProps.position)), @@ -9,7 +15,7 @@ const mapDispatchToProps = (dispatch, ownProps) => { }; const EmptySlotContainer = connect( - undefined, + mapStateToProps, mapDispatchToProps )(EmptySlotComponent); -- cgit v1.2.3