Skip to content

Commit

Permalink
Dismiss animation based on delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Ell1ott committed Dec 22, 2024
1 parent 6820cd1 commit b2bfe1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/components/swipe-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ function SwipeCard({ card, index, totalCards, onDismiss, setIsAnimating }: Swipe
velocity: event.velocityX,
damping: 15
}, () => {
runOnJS(onDismiss)(direction);
});
runOnJS(() => setTimeout(() => {
onDismiss(direction);
}, 200))();
translateY.value = withSpring(-100, { damping: 250 });
} else {
console.log('reset');
Expand Down

0 comments on commit b2bfe1e

Please sign in to comment.