From 098e6386fd7f846786aa26bc5da4884e2ab3b26b Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 23 Oct 2025 11:53:50 +0700 Subject: fix varian and ready stock badge --- src/lib/product/components/ProductCard.jsx | 53 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 7c47a10d..a296eff3 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -92,24 +92,6 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { className='gambarA w-full object-contain object-center h-36 sm:h-48' /> - {/* PICK UP NOW badge (kanan-atas gambar) */} - {product?.isInBu && ( - - Pick Up Now - - )} -
{product?.isSni && ( @@ -138,15 +120,36 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
- {/* BADGE DISKON KIRI-ATAS (match mobile) */} + {/* BADGE DISKON Kanan-ATAS */} {(product?.lowestPrice?.discountPercentage ?? 0) > 0 && ( -
-
+
+
{Math.floor(product.lowestPrice.discountPercentage)}%
)} + {/* BOTTOM-LEFT: Varian + PICK UP NOW */} + {(product?.variantTotal > 1 || product?.isInBu) && ( +
+ {product?.variantTotal > 1 && ( +
+ {product.variantTotal} Varian +
+ )} + {product?.isInBu && ( + Pick Up Now + )} +
+ )} + {router.pathname != '/' && product?.flashSale?.id > 0 && (
@@ -184,11 +187,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
)} - {product.variantTotal > 1 && ( + {/* {product.variantTotal > 1 && (
{product.variantTotal} Varian
- )} + )} */}
@@ -358,7 +361,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
- {/* BADGE DISKON KIRI-ATAS (tetap) */} + {/* BADGE DISKON Kanan-ATAS */} {(product?.lowestPrice?.discountPercentage ?? 0) > 0 && (
@@ -369,7 +372,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {/* BOTTOM-LEFT: Varian + PICK UP NOW */} {(product?.variantTotal > 1 || product?.isInBu) && ( -
+
{product?.variantTotal > 1 && (
{product.variantTotal} Varian -- cgit v1.2.3