This commit is contained in:
everythingonblack
2025-08-19 00:34:23 +07:00
parent e3154e4cde
commit 56961ef8f6
5 changed files with 9 additions and 4 deletions

View File

@@ -182,7 +182,7 @@ const CoverflowCarousel = ({ products, onCardClick }) => {
<div className={styles.cardWrapper}>
<ProductCard
product={product}
onCardClick={(p) => { onCardClick && onCardClick(p); }}
onCardClick={(p,d) => { onCardClick && onCardClick(p,d); }}
isCenter={position === 0}
canHover={position === 0 && animationState === 'ready' && !shiftDirection && !isDragging}
onCollapse={position === 0 ? collapseOverlay : undefined}

View File

@@ -33,7 +33,7 @@ const ProductCard = ({ product, onCardClick, isCenter, canHover, onCollapse }) =
<div className={styles.buttonGroup}>
<button
className={styles.detailButton}
onClick={(e) => { e.preventDefault(); e.stopPropagation(); onCardClick && onCardClick(product); }}
onClick={(e) => { e.preventDefault(); e.stopPropagation(); onCardClick && onCardClick(product, true); }}
>
Detail
</button>

View File

@@ -41,7 +41,12 @@ const ProductSection = ({ setSelectedProduct, setShowedModal, productSectionRef,
}, [selectedCategory, products]);
// Handle product selection for detail view
const handleViewDetail = (product) => {
const handleViewDetail = (product, detailed) => {
if(detailed) {
setSelectedProduct(product);
setShowedModal('product');
return;
}
setSelectedProduct(product);
setShowedModal('product');
setWillDo('checkout');