Optimise grid and interaction context

This commit is contained in:
Mitchell McCaffrey
2021-03-12 11:02:58 +11:00
parent 01d738b9c6
commit e6fd10a904
14 changed files with 406 additions and 135 deletions

View File

@@ -1,7 +1,10 @@
import React from "react";
import { useAuth } from "../../contexts/AuthContext";
import { useMapInteraction } from "../../contexts/MapInteractionContext";
import {
useMapWidth,
useMapHeight,
} from "../../contexts/MapInteractionContext";
import DragOverlay from "../DragOverlay";
@@ -15,7 +18,9 @@ function TokenDragOverlay({
mapState,
}) {
const { userId } = useAuth();
const { mapWidth, mapHeight } = useMapInteraction();
const mapWidth = useMapWidth();
const mapHeight = useMapHeight();
function handleTokenRemove() {
// Handle other tokens when a vehicle gets deleted