From f119fc78dda4d1e828dde04f378a63a93e3a0a7e Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 2 Jul 2020 18:39:28 +0200 Subject: Add current progress on frontend port --- .../src/components/app/map/groups/TopologyGroup.js | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 frontend/src/components/app/map/groups/TopologyGroup.js (limited to 'frontend/src/components/app/map/groups/TopologyGroup.js') diff --git a/frontend/src/components/app/map/groups/TopologyGroup.js b/frontend/src/components/app/map/groups/TopologyGroup.js new file mode 100644 index 00000000..a40a1d41 --- /dev/null +++ b/frontend/src/components/app/map/groups/TopologyGroup.js @@ -0,0 +1,40 @@ +import React from 'react' +import { Group } from 'react-konva' +import GrayContainer from '../../../../containers/app/map/GrayContainer' +import RoomContainer from '../../../../containers/app/map/RoomContainer' +import Shapes from '../../../../shapes/index' + +const TopologyGroup = ({ topology, interactionLevel }) => { + if (!topology) { + return + } + + if (interactionLevel.mode === 'BUILDING') { + return ( + + {topology.roomIds.map(roomId => ( + + ))} + + ) + } + + return ( + + {topology.roomIds + .filter(roomId => roomId !== interactionLevel.roomId) + .map(roomId => )} + {interactionLevel.mode === 'ROOM' ? : null} + {topology.roomIds + .filter(roomId => roomId === interactionLevel.roomId) + .map(roomId => )} + + ) +} + +TopologyGroup.propTypes = { + topology: Shapes.Topology, + interactionLevel: Shapes.InteractionLevel, +} + +export default TopologyGroup -- cgit v1.2.3