summaryrefslogtreecommitdiff
path: root/frontend/src/containers/app/map/layers/ObjectHoverLayer.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-01 13:33:31 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:47:17 +0200
commitde8f12d74faef5fa3f9e38d1340948cab2d06ea3 (patch)
tree678bf1af3e5fa2334f0df43388d45294785bbf1e /frontend/src/containers/app/map/layers/ObjectHoverLayer.js
parent44236756c4cf689806dc17c6950a2cff3e9227bf (diff)
Manually generate IDs
Diffstat (limited to 'frontend/src/containers/app/map/layers/ObjectHoverLayer.js')
-rw-r--r--frontend/src/containers/app/map/layers/ObjectHoverLayer.js54
1 files changed, 27 insertions, 27 deletions
diff --git a/frontend/src/containers/app/map/layers/ObjectHoverLayer.js b/frontend/src/containers/app/map/layers/ObjectHoverLayer.js
index 9b28575e..dc489e82 100644
--- a/frontend/src/containers/app/map/layers/ObjectHoverLayer.js
+++ b/frontend/src/containers/app/map/layers/ObjectHoverLayer.js
@@ -1,37 +1,37 @@
-import { connect } from "react-redux";
-import { addRackToTile } from "../../../../actions/topology/room";
-import ObjectHoverLayerComponent from "../../../../components/app/map/layers/ObjectHoverLayerComponent";
-import { findTileWithPosition } from "../../../../util/tile-calculations";
+import { connect } from 'react-redux'
+import { addRackToTile } from '../../../../actions/topology/room'
+import ObjectHoverLayerComponent from '../../../../components/app/map/layers/ObjectHoverLayerComponent'
+import { findTileWithPosition } from '../../../../util/tile-calculations'
const mapStateToProps = state => {
- return {
- mapPosition: state.map.position,
- mapScale: state.map.scale,
- isEnabled: () => state.construction.inRackConstructionMode,
- isValid: (x, y) => {
- if (state.interactionLevel.mode !== "ROOM") {
- return false;
- }
+ return {
+ mapPosition: state.map.position,
+ mapScale: state.map.scale,
+ isEnabled: () => state.construction.inRackConstructionMode,
+ isValid: (x, y) => {
+ if (state.interactionLevel.mode !== 'ROOM') {
+ return false
+ }
- const currentRoom = state.objects.room[state.interactionLevel.roomId];
- const tiles = currentRoom.tileIds.map(
- tileId => state.objects.tile[tileId]
- );
- const tile = findTileWithPosition(tiles, x, y);
+ const currentRoom = state.objects.room[state.interactionLevel.roomId]
+ const tiles = currentRoom.tileIds.map(
+ tileId => state.objects.tile[tileId],
+ )
+ const tile = findTileWithPosition(tiles, x, y)
- return !(tile === null || tile.objectType);
+ return !(tile === null || tile.objectType)
+ },
}
- };
-};
+}
const mapDispatchToProps = dispatch => {
- return {
- onClick: (x, y) => dispatch(addRackToTile(x, y))
- };
-};
+ return {
+ onClick: (x, y) => dispatch(addRackToTile(x, y)),
+ }
+}
const ObjectHoverLayer = connect(mapStateToProps, mapDispatchToProps)(
- ObjectHoverLayerComponent
-);
+ ObjectHoverLayerComponent,
+)
-export default ObjectHoverLayer;
+export default ObjectHoverLayer