diff options
Diffstat (limited to 'src/components/map/elements/MapTile.js')
| -rw-r--r-- | src/components/map/elements/MapTile.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/map/elements/MapTile.js b/src/components/map/elements/MapTile.js new file mode 100644 index 00000000..b0f4959d --- /dev/null +++ b/src/components/map/elements/MapTile.js @@ -0,0 +1,24 @@ +import PropTypes from "prop-types"; +import React from "react"; +import {Group, Rect} from "react-konva"; +import {TILE_SIZE_IN_PIXELS} from "../MapConstants"; + +const MapTile = () => ( + <Group> + <Rect + x={this.props.tileX * TILE_SIZE_IN_PIXELS} + y={this.props.tileY * TILE_SIZE_IN_PIXELS} + width={TILE_SIZE_IN_PIXELS} + height={TILE_SIZE_IN_PIXELS} + fill={this.props.fillColor} + /> + </Group> +); + +MapTile.propTypes = { + tileX: PropTypes.number.isRequired, + tileY: PropTypes.number.isRequired, + fillColor: PropTypes.string.isRequired, +}; + +export default MapTile; |
