summaryrefslogtreecommitdiff
path: root/src/components/sidebars/topology
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-31 17:59:51 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:50 +0200
commit3f736cd3db63f106eac02f220477b4a0f3b0eceb (patch)
tree80afa73f8c4d281b2fccba8ad2baa7c10f7e7e84 /src/components/sidebars/topology
parentb17f1d8cb4815f57a4b7043cc91b867ec3cbc867 (diff)
Implement room creation
Diffstat (limited to 'src/components/sidebars/topology')
-rw-r--r--src/components/sidebars/topology/TopologySidebarComponent.js27
-rw-r--r--src/components/sidebars/topology/building/BuildingSidebarContentComponent.js20
-rw-r--r--src/components/sidebars/topology/building/CancelNewRoomConstructionComponent.js9
-rw-r--r--src/components/sidebars/topology/building/FinishNewRoomConstructionComponent.js9
-rw-r--r--src/components/sidebars/topology/building/StartNewRoomConstructionComponent.js9
5 files changed, 74 insertions, 0 deletions
diff --git a/src/components/sidebars/topology/TopologySidebarComponent.js b/src/components/sidebars/topology/TopologySidebarComponent.js
new file mode 100644
index 00000000..932d2ecf
--- /dev/null
+++ b/src/components/sidebars/topology/TopologySidebarComponent.js
@@ -0,0 +1,27 @@
+import React from "react";
+import BuildingSidebarContent from "../../../containers/sidebars/topology/building/BuildingSidebarContent";
+import Sidebar from "../Sidebar";
+
+const TopologySidebarComponent = ({interactionLevel}) => {
+ let sidebarHeading;
+ let sidebarContent;
+
+ switch (interactionLevel.mode) {
+ case "BUILDING":
+ sidebarHeading = "Building";
+ sidebarContent = <BuildingSidebarContent/>;
+ break;
+ default:
+ sidebarHeading = "Error";
+ sidebarContent = "Missing Content";
+ }
+
+ return (
+ <Sidebar isRight={true}>
+ <h3>{sidebarHeading}</h3>
+ {sidebarContent}
+ </Sidebar>
+ );
+};
+
+export default TopologySidebarComponent;
diff --git a/src/components/sidebars/topology/building/BuildingSidebarContentComponent.js b/src/components/sidebars/topology/building/BuildingSidebarContentComponent.js
new file mode 100644
index 00000000..b88b23b7
--- /dev/null
+++ b/src/components/sidebars/topology/building/BuildingSidebarContentComponent.js
@@ -0,0 +1,20 @@
+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";
+
+const BuildingSidebarContentComponent = ({currentRoomInConstruction}) => {
+ if (currentRoomInConstruction !== -1) {
+ return (
+ <div>
+ <FinishNewRoomConstructionButton/>
+ <CancelNewRoomConstructionButton/>
+ </div>
+ );
+ }
+ return (
+ <StartNewRoomConstructionButton/>
+ );
+};
+
+export default BuildingSidebarContentComponent;
diff --git a/src/components/sidebars/topology/building/CancelNewRoomConstructionComponent.js b/src/components/sidebars/topology/building/CancelNewRoomConstructionComponent.js
new file mode 100644
index 00000000..15f199a6
--- /dev/null
+++ b/src/components/sidebars/topology/building/CancelNewRoomConstructionComponent.js
@@ -0,0 +1,9 @@
+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
new file mode 100644
index 00000000..d9edbb61
--- /dev/null
+++ b/src/components/sidebars/topology/building/FinishNewRoomConstructionComponent.js
@@ -0,0 +1,9 @@
+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/StartNewRoomConstructionComponent.js b/src/components/sidebars/topology/building/StartNewRoomConstructionComponent.js
new file mode 100644
index 00000000..60573532
--- /dev/null
+++ b/src/components/sidebars/topology/building/StartNewRoomConstructionComponent.js
@@ -0,0 +1,9 @@
+import React from "react";
+
+const StartNewRoomConstructionComponent = ({onClick}) => (
+ <div className="btn btn-primary btn-block" onClick={onClick}>
+ Construct a new room
+ </div>
+);
+
+export default StartNewRoomConstructionComponent;