summaryrefslogtreecommitdiff
path: root/src/components/map/layers/HoverTileLayerComponent.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-04 09:10:46 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:57 +0200
commit6f3afd0317a8e549f77ad6764f6dbe4d4953b67c (patch)
tree767379e013d56b87ac814327f6fc4d789c23947e /src/components/map/layers/HoverTileLayerComponent.js
parentf4389bd0df1669969339b8b43b61fb78e7c1be25 (diff)
Add plus icon component
Diffstat (limited to 'src/components/map/layers/HoverTileLayerComponent.js')
-rw-r--r--src/components/map/layers/HoverTileLayerComponent.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/map/layers/HoverTileLayerComponent.js b/src/components/map/layers/HoverTileLayerComponent.js
index a4d9446a..bd07596a 100644
--- a/src/components/map/layers/HoverTileLayerComponent.js
+++ b/src/components/map/layers/HoverTileLayerComponent.js
@@ -1,9 +1,19 @@
+import PropTypes from "prop-types";
import React from 'react';
import {Layer} from "react-konva";
import HoverTile from "../elements/HoverTile";
import {TILE_SIZE_IN_PIXELS} from "../MapConstants";
class HoverTileLayerComponent extends React.Component {
+ static propTypes = {
+ mouseX: PropTypes.number.isRequired,
+ mouseY: PropTypes.number.isRequired,
+ mainGroupX: PropTypes.number.isRequired,
+ mainGroupY: PropTypes.number.isRequired,
+ onClick: PropTypes.func.isRequired,
+ containsRack: PropTypes.bool,
+ };
+
state = {
positionX: -1,
positionY: -1,
@@ -34,7 +44,7 @@ class HoverTileLayerComponent extends React.Component {
const pixelY = positionY * TILE_SIZE_IN_PIXELS + this.props.mainGroupY;
return (
- <Layer>
+ <Layer opacity={0.4}>
<HoverTile
pixelX={pixelX} pixelY={pixelY}
isValid={this.state.validity} onClick={() => this.props.onClick(positionX, positionY)}