diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-26 13:53:21 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:45 +0200 |
| commit | bbb802b4142d11f020994ac4d9ae9c1610ac4038 (patch) | |
| tree | ea5419b2c1c0fc2af22c11e94b4981a9445ec26c /src/components/map/groups/DatacenterGroup.js | |
| parent | 8302923a08728d36746af3560ebc35685c2b9da5 (diff) | |
Enable going from room to tile and back
Diffstat (limited to 'src/components/map/groups/DatacenterGroup.js')
| -rw-r--r-- | src/components/map/groups/DatacenterGroup.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/components/map/groups/DatacenterGroup.js b/src/components/map/groups/DatacenterGroup.js index cd4baaa5..2f4dc2eb 100644 --- a/src/components/map/groups/DatacenterGroup.js +++ b/src/components/map/groups/DatacenterGroup.js @@ -9,21 +9,7 @@ const DatacenterGroup = ({datacenter, interactionLevel}) => { return <Group/>; } - if (interactionLevel.mode === "ROOM") { - return ( - <Group> - {datacenter.rooms - .filter(room => room.id !== interactionLevel.roomId) - .map(room => <RoomContainer key={room.id} room={room}/>) - } - <GrayContainer/> - {datacenter.rooms - .filter(room => room.id === interactionLevel.roomId) - .map(room => <RoomContainer key={room.id} room={room}/>) - } - </Group> - ); - } else { + if (interactionLevel.mode === "BUILDING") { return ( <Group> {datacenter.rooms.map(room => ( @@ -32,6 +18,20 @@ const DatacenterGroup = ({datacenter, interactionLevel}) => { </Group> ); } + + return ( + <Group> + {datacenter.rooms + .filter(room => room.id !== interactionLevel.roomId) + .map(room => <RoomContainer key={room.id} room={room}/>) + } + {interactionLevel.mode === "ROOM" ? <GrayContainer/> : null} + {datacenter.rooms + .filter(room => room.id === interactionLevel.roomId) + .map(room => <RoomContainer key={room.id} room={room}/>) + } + </Group> + ); }; DatacenterGroup.propTypes = { |
