Skip to content

Commit

Permalink
updated tests and rename useReorderFavorite to useHandleFavoriteDragA…
Browse files Browse the repository at this point in the history
…ndDrop
  • Loading branch information
ehconitin committed Dec 14, 2024
1 parent 6a3f662 commit 84f749b
Show file tree
Hide file tree
Showing 5 changed files with 512 additions and 366 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FavoritesDragContext } from '@/favorites/contexts/FavoritesDragContext';
import { useReorderFavorite } from '@/favorites/hooks/useReorderFavorite';
import { useHandleFavoriteDragAndDrop } from '@/favorites/hooks/useHandleFavoriteDragAndDrop';
import {
DragDropContext,
DragStart,
Expand All @@ -16,15 +16,15 @@ export const FavoritesDragProvider = ({
children,
}: FavoritesDragProviderProps) => {
const [isDragging, setIsDragging] = useState(false);
const { handleReorderFavorite } = useReorderFavorite();
const { handleFavoriteDragAndDrop } = useHandleFavoriteDragAndDrop();

const handleDragStart = (_: DragStart) => {
setIsDragging(true);
};

const handleDragEnd = (result: DropResult, provided: ResponderProvided) => {
setIsDragging(false);
handleReorderFavorite(result, provided);
handleFavoriteDragAndDrop(result, provided);
};

return (
Expand Down
Loading

0 comments on commit 84f749b

Please sign in to comment.