Remove need to pass node into drag overlay

This commit is contained in:
Mitchell McCaffrey
2021-07-22 16:40:33 +10:00
parent 93ce4bab0e
commit 19139dec82
6 changed files with 14 additions and 34 deletions
+2 -6
View File
@@ -31,11 +31,8 @@ function useMapNotes(
setIsNoteMenuOpen(true);
}
function handleNoteDragStart(
event: KonvaEventObject<DragEvent>,
noteId: string
) {
setNoteDraggingOptions({ dragging: true, noteId, noteGroup: event.target });
function handleNoteDragStart(_: KonvaEventObject<DragEvent>, noteId: string) {
setNoteDraggingOptions({ dragging: true, noteId });
}
function handleNoteDragEnd() {
@@ -86,7 +83,6 @@ function useMapNotes(
const noteDragOverlay = noteDraggingOptions ? (
<NoteDragOverlay
dragging={noteDraggingOptions.dragging}
noteGroup={noteDraggingOptions.noteGroup}
noteId={noteDraggingOptions.noteId}
onNoteRemove={handleNoteRemove}
/>