From 8302923a08728d36746af3560ebc35685c2b9da5 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 25 Aug 2017 23:03:05 +0200 Subject: Enable going from building to room and back --- src/components/map/groups/DatacenterGroup.js | 37 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'src/components/map/groups/DatacenterGroup.js') diff --git a/src/components/map/groups/DatacenterGroup.js b/src/components/map/groups/DatacenterGroup.js index d7e349be..cd4baaa5 100644 --- a/src/components/map/groups/DatacenterGroup.js +++ b/src/components/map/groups/DatacenterGroup.js @@ -1,23 +1,42 @@ import React from "react"; import {Group} from "react-konva"; +import GrayContainer from "../../../containers/map/GrayContainer"; +import RoomContainer from "../../../containers/map/RoomContainer"; import Shapes from "../../../shapes/index"; -import RoomGroup from "./RoomGroup"; -const DatacenterGroup = ({datacenter}) => { +const DatacenterGroup = ({datacenter, interactionLevel}) => { if (!datacenter) { return ; } - return ( - - {datacenter.rooms.map(room => ( - - ))} - - ); + + if (interactionLevel.mode === "ROOM") { + return ( + + {datacenter.rooms + .filter(room => room.id !== interactionLevel.roomId) + .map(room => ) + } + + {datacenter.rooms + .filter(room => room.id === interactionLevel.roomId) + .map(room => ) + } + + ); + } else { + return ( + + {datacenter.rooms.map(room => ( + + ))} + + ); + } }; DatacenterGroup.propTypes = { datacenter: Shapes.Datacenter, + interactionLevel: Shapes.InteractionLevel, }; export default DatacenterGroup; -- cgit v1.2.3