diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-22 17:08:55 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:44 +0200 |
| commit | 1ddbbd3563af77a218020021ea50a8832900b4db (patch) | |
| tree | 5647f9cfde2de3918eeeac58d6c598bb55e50d82 /src/components/map/groups | |
| parent | 602c3eb9327a3681f5a220e13b8291bb60643cd7 (diff) | |
Add route logic for construction routes
Diffstat (limited to 'src/components/map/groups')
| -rw-r--r-- | src/components/map/groups/DatacenterGroup.js | 17 | ||||
| -rw-r--r-- | src/components/map/groups/RoomGroup.js | 19 |
2 files changed, 27 insertions, 9 deletions
diff --git a/src/components/map/groups/DatacenterGroup.js b/src/components/map/groups/DatacenterGroup.js new file mode 100644 index 00000000..3b7a086b --- /dev/null +++ b/src/components/map/groups/DatacenterGroup.js @@ -0,0 +1,17 @@ +import React from "react"; +import {Group} from "react-konva"; +import RoomGroup from "./RoomGroup"; + +const DatacenterGroup = ({datacenter}) => ( + <Group> + {datacenter.rooms.map(room => ( + <RoomGroup room={room}/> + ))} + </Group> +); + +DatacenterGroup.propTypes = { + datacenter: Shapes.Datacenter, +}; + +export default DatacenterGroup; diff --git a/src/components/map/groups/RoomGroup.js b/src/components/map/groups/RoomGroup.js index 1a8b18d5..90a58767 100644 --- a/src/components/map/groups/RoomGroup.js +++ b/src/components/map/groups/RoomGroup.js @@ -1,16 +1,17 @@ import React from "react"; -import {Group, Rect} from "react-konva"; +import {Group} from "react-konva"; +import TileGroup from "./TileGroup"; -const RoomGroup = () => ( +const RoomGroup = ({room}) => ( <Group> - <Rect - x={10} - y={10} - width={50} - height={50} - fill="green" - /> + {room.tiles.map(tile => ( + <TileGroup tile={tile}/> + ))} </Group> ); +RoomGroup.propTypes = { + room: Shapes.Room, +}; + export default RoomGroup; |
