diff options
Diffstat (limited to 'src/components/sidebars/topology/building')
5 files changed, 29 insertions, 37 deletions
diff --git a/src/components/sidebars/topology/building/BuildingSidebarComponent.js b/src/components/sidebars/topology/building/BuildingSidebarComponent.js index 002184ae..835943f2 100644 --- a/src/components/sidebars/topology/building/BuildingSidebarComponent.js +++ b/src/components/sidebars/topology/building/BuildingSidebarComponent.js @@ -1,18 +1,13 @@ import React from "react"; -import CancelNewRoomConstructionButton from "../../../../containers/sidebars/topology/building/CancelNewRoomConstructionButton"; -import FinishNewRoomConstructionButton from "../../../../containers/sidebars/topology/building/FinishNewRoomConstructionButton"; -import StartNewRoomConstructionButton from "../../../../containers/sidebars/topology/building/StartNewRoomConstructionButton"; +import NewRoomConstructionContainer from "../../../../containers/sidebars/topology/building/NewRoomConstructionContainer"; -const BuildingSidebarComponent = ({currentRoomInConstruction}) => { +const BuildingSidebarComponent = ({inSimulation}) => { return ( <div> <h2>Building</h2> - {currentRoomInConstruction === -1 ? - <StartNewRoomConstructionButton/> : - <div> - <FinishNewRoomConstructionButton/> - <CancelNewRoomConstructionButton/> - </div> + {inSimulation ? + undefined : + <NewRoomConstructionContainer/> } </div> ); diff --git a/src/components/sidebars/topology/building/CancelNewRoomConstructionComponent.js b/src/components/sidebars/topology/building/CancelNewRoomConstructionComponent.js deleted file mode 100644 index 15f199a6..00000000 --- a/src/components/sidebars/topology/building/CancelNewRoomConstructionComponent.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; - -const CancelNewRoomConstructionComponent = ({onClick}) => ( - <div className="btn btn-default btn-block" onClick={onClick}> - Cancel construction - </div> -); - -export default CancelNewRoomConstructionComponent; diff --git a/src/components/sidebars/topology/building/FinishNewRoomConstructionComponent.js b/src/components/sidebars/topology/building/FinishNewRoomConstructionComponent.js deleted file mode 100644 index d9edbb61..00000000 --- a/src/components/sidebars/topology/building/FinishNewRoomConstructionComponent.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; - -const FinishNewRoomConstructionComponent = ({onClick}) => ( - <div className="btn btn-primary btn-block" onClick={onClick}> - Finalize new room - </div> -); - -export default FinishNewRoomConstructionComponent; diff --git a/src/components/sidebars/topology/building/NewRoomConstructionComponent.js b/src/components/sidebars/topology/building/NewRoomConstructionComponent.js new file mode 100644 index 00000000..581330ab --- /dev/null +++ b/src/components/sidebars/topology/building/NewRoomConstructionComponent.js @@ -0,0 +1,24 @@ +import React from "react"; + +const NewRoomConstructionComponent = ({onStart, onFinish, onCancel, currentRoomInConstruction}) => { + if (currentRoomInConstruction === -1) { + return ( + <div className="btn btn-primary btn-block" onClick={onStart}> + Construct a new room + </div> + ); + } + return ( + <div> + <div className="btn btn-primary btn-block" onClick={onFinish}> + Finalize new room + </div> + <div className="btn btn-default btn-block" onClick={onCancel}> + Cancel construction + </div> + </div> + ); + +}; + +export default NewRoomConstructionComponent; diff --git a/src/components/sidebars/topology/building/StartNewRoomConstructionComponent.js b/src/components/sidebars/topology/building/StartNewRoomConstructionComponent.js deleted file mode 100644 index 60573532..00000000 --- a/src/components/sidebars/topology/building/StartNewRoomConstructionComponent.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; - -const StartNewRoomConstructionComponent = ({onClick}) => ( - <div className="btn btn-primary btn-block" onClick={onClick}> - Construct a new room - </div> -); - -export default StartNewRoomConstructionComponent; |
