diff --git a/frontend/src/components/SwipeableCard.tsx b/frontend/src/components/SwipeableCard.tsx index 83b7caf..b16cd38 100644 --- a/frontend/src/components/SwipeableCard.tsx +++ b/frontend/src/components/SwipeableCard.tsx @@ -21,15 +21,22 @@ function SwipeableCard({ content, onSwiped }: SwipeableCardProps) { onSwipedUp: () => handleSwipe("up"), onSwipedDown: () => handleSwipe("down"), onSwiping: (eventData) => handleSwiping(eventData), + onTap: (eventData) => handleTapping(eventData), }); const handleSwipe = (dir: string) => { - setWatermark(null); - setIsFlipped(true); - setTimeout(() => { + if(dir === "up" ) { + setWatermark(null); + setIsFlipped(true); + } else { + setWatermark(null); onSwiped(dir); - setIsFlipped(false); - }, 600); // Match the duration of the CSS transition + } + }; + + const handleTapping = ({ dir }: { dir: string }) => { + setIsFlipped(false); + console.log(dir); }; const handleSwiping = ({ dir }: { dir: string }) => { diff --git a/frontend/src/pages/Error404.tsx b/frontend/src/pages/Error404.tsx index 8e1d1ca..00194e9 100644 --- a/frontend/src/pages/Error404.tsx +++ b/frontend/src/pages/Error404.tsx @@ -3,12 +3,15 @@ import { Link } from "react-router-dom"; const Error404 = () => { return ( -
+

404 - Page Not Found

Sorry, the page you are looking for does not exist.

- + Go to Home
diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index aac75d4..016ca04 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -13,11 +13,12 @@ function Home() { const [currentCardIndex, setCurrentCardIndex] = useState(0); const handleSwiped = (dir: string) => { - if (dir === "left") { - setCurrentCardIndex((prev) => (prev > 0 ? prev - 1 : cards.length - 1)); - } else if (dir === "right") { - setCurrentCardIndex((prev) => (prev + 1) % cards.length); - } + setCurrentCardIndex((prev) => (prev + 1) % cards.length); + // if (dir === "left") { + // setCurrentCardIndex((prev) => (prev > 0 ? prev - 1 : cards.length - 1)); + // } else if (dir === "right") { + // setCurrentCardIndex((prev) => (prev + 1) % cards.length); + // } }; return (