Add ability to drag and drop a tile onto the map and added better drag cursors

This commit is contained in:
Mitchell McCaffrey
2021-05-28 17:06:20 +10:00
parent f84baab6fb
commit bac3101886
12 changed files with 400 additions and 186 deletions
+3 -1
View File
@@ -20,7 +20,7 @@ import {
import { useGroup } from "../../contexts/GroupContext";
function SortableTiles({ renderTile, subgroup }) {
const { dragId, overId } = useTileDrag();
const { dragId, overId, dragCursor } = useTileDrag();
const {
groups: allGroups,
selectedGroupIds: allSelectedIds,
@@ -88,6 +88,7 @@ function SortableTiles({ renderTile, subgroup }) {
<div
style={{
transform: `translate(${coords[index].x}%, ${coords[index].y}%)`,
cursor: dragCursor,
}}
>
<animated.div style={dragBounce}>
@@ -137,6 +138,7 @@ function SortableTiles({ renderTile, subgroup }) {
disableSorting={disableSorting}
hidden={group.id === openGroupId}
isDragging={isDragging}
cursor={dragCursor}
>
{renderSortableGroup(group, selectedGroups)}
</SortableTile>