From db8be074882f660a67cb9487b163e769c3515797 Mon Sep 17 00:00:00 2001 From: grim <75869731+vys69@users.noreply.github.com> Date: Sat, 21 Sep 2024 23:59:08 -0700 Subject: [PATCH] oops --- src/components/ui/SwipeableCard.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/ui/SwipeableCard.tsx b/src/components/ui/SwipeableCard.tsx index a012b43..4b8bee8 100644 --- a/src/components/ui/SwipeableCard.tsx +++ b/src/components/ui/SwipeableCard.tsx @@ -4,9 +4,10 @@ import { Trash2 } from "lucide-react"; interface SwipeableCardProps { children: React.ReactNode; onDelete: () => void; + isItemChanged: boolean; } -const SwipeableCard: React.FC = ({ children, onDelete }) => { +const SwipeableCard: React.FC = ({ children, onDelete, isItemChanged }) => { const [offset, setOffset] = useState(0); const [startX, setStartX] = useState(0); const [isDeleting, setIsDeleting] = useState(false); @@ -50,8 +51,8 @@ const SwipeableCard: React.FC = ({ children, onDelete }) => }, []); return ( -
handleStart(e.touches[0].clientX)} onTouchMove={(e) => handleMove(e.touches[0].clientX)} @@ -65,7 +66,9 @@ const SwipeableCard: React.FC = ({ children, onDelete }) => className={`transition-transform duration-300 ease-out ${isDeleting ? 'transform -translate-x-full' : ''}`} style={{ transform: `translateX(${offset}px)` }} > - {children} +
+ {children} +