diff --git a/react-frontend/src/components/Listing/Listing.css b/react-frontend/src/components/Listing/Listing.css index 2d21513..c4ddd79 100644 --- a/react-frontend/src/components/Listing/Listing.css +++ b/react-frontend/src/components/Listing/Listing.css @@ -19,6 +19,7 @@ width: 100%; height: 200px; overflow: hidden; + cursor: pointer; } .listing__image { diff --git a/react-frontend/src/components/Listing/Listing.js b/react-frontend/src/components/Listing/Listing.js index 1a45f2e..7f87b37 100644 --- a/react-frontend/src/components/Listing/Listing.js +++ b/react-frontend/src/components/Listing/Listing.js @@ -55,16 +55,25 @@ const Listing = ({ setTimeout(() => setAlertMessage(null), 2000) } } + const handleNextImageClick = (e) => { + e.stopPropagation(); // Prevent event from bubbling up + handleNextImage(); + }; + + const handleWatchlistToggleClick = (e) => { + e.stopPropagation(); // Prevent event from bubbling up + handleWatchlistToggle(); + }; return ( -
+
{title} -
-
+
{title}
{price} {currency} @@ -72,14 +81,14 @@ const Listing = ({
{createdAt}
{showWatchlistIcon && ( -
+
Watchlist
)} {alertMessage && }
- ) -} + ); +}; Listing.propTypes = { images: PropTypes.arrayOf(PropTypes.string).isRequired,