diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-22 10:48:01 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:44 +0200 |
| commit | 602c3eb9327a3681f5a220e13b8291bb60643cd7 (patch) | |
| tree | 08bbcad1460419af12c59ecf60d102af161bf57f /src/components/map/groups/TileGroup.js | |
| parent | 193e7b32d5e3d356021a5bb8f777fec3bdc413e7 (diff) | |
Add tile rendering logic
Diffstat (limited to 'src/components/map/groups/TileGroup.js')
| -rw-r--r-- | src/components/map/groups/TileGroup.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/components/map/groups/TileGroup.js b/src/components/map/groups/TileGroup.js new file mode 100644 index 00000000..7493f953 --- /dev/null +++ b/src/components/map/groups/TileGroup.js @@ -0,0 +1,29 @@ +import React from "react"; +import {Group} from "react-konva"; +import Shapes from "../../../shapes/index"; +import RoomTile from "../elements/RoomTile"; +import RackGroup from "./RackGroup"; + +const TileGroup = ({tile}) => { + let tileObject; + switch (tile.objectType) { + case "RACK": + tileObject = <RackGroup tile={tile}/>; + break; + default: + tileObject = null; + } + + return ( + <Group> + <RoomTile tile={tile}/> + {tileObject} + </Group> + ); +}; + +TileGroup.propTypes = { + tile: Shapes.Tile, +}; + +export default TileGroup; |
