summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/map/elements/RoomTile.js
blob: 43bf918e4dc7dbf9b015e0f06ba4f942010f14af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from 'react'
import { Rect } from 'react-konva'
import Shapes from '../../../../shapes/index'
import { TILE_SIZE_IN_PIXELS } from '../MapConstants'

const RoomTile = ({ tile, color }) => (
    <Rect
        x={tile.positionX * TILE_SIZE_IN_PIXELS}
        y={tile.positionY * TILE_SIZE_IN_PIXELS}
        width={TILE_SIZE_IN_PIXELS}
        height={TILE_SIZE_IN_PIXELS}
        fill={color}
    />
)

RoomTile.propTypes = {
    tile: Shapes.Tile,
}

export default RoomTile