From 24ed40386d77d80fe892fe07d3ba91be07b08ca5 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Wed, 15 Oct 2025 10:59:35 +0700 Subject: fix pickup now mobile badge --- src/lib/product/components/ProductCard.jsx | 157 ++++++++++++----------------- 1 file changed, 66 insertions(+), 91 deletions(-) diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index d5188d5c..ed804fec 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -287,25 +287,47 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { alt={product?.name} 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 && ( )}
-
+
{product?.isTkdn && ( {
- {/* BADGE DISKON KIRI-ATAS */} + + {/* BADGE DISKON KIRI-ATAS (tetap seperti punyamu) */} {(product?.lowestPrice?.discountPercentage ?? 0) > 0 && ( -
+
{Math.floor(product.lowestPrice.discountPercentage)}%
@@ -331,7 +354,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {router.pathname != '/' && product?.flashSale?.id > 0 && ( -
+
{ />
- {/* Old */} + {/* Old (dibiarkan komentar persis punyamu) */} {/*
-
- - {Math.floor(product?.lowestPrice.discountPercentage)}% - -
-
- - - {product?.flashSale?.tag != 'false' || - product?.flashSale?.tag - ? product?.flashSale?.tag - : 'FLASH SALE'} - -
-
*/} +
+ + {Math.floor(product?.lowestPrice.discountPercentage)}% + +
+
+ + + {product?.flashSale?.tag != 'false' || product?.flashSale?.tag + ? product?.flashSale?.tag + : 'FLASH SALE'} + +
+
*/}
)} @@ -374,6 +396,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
)} +
{product?.manufacture?.name ? ( @@ -387,45 +410,10 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { ) : (
-
)} - {/* PICK UP NOW badge (kanan-atas gambar) */} - {product?.isInBu && ( - - - PICK UP NOW - - - )} - {/* Old */} - {/* {product?.isInBu && ( - - pickup now - - )} */} + {/* (Dihapus yang versi header agar tidak dobel, sesuai instruksi sebelumnya) */}
+ { > {product?.name} + {product?.flashSale?.id > 0 && product?.lowestPrice.discountPercentage > 0 ? (
- {/* harga sekarang (merah) */} + {/* harga sekarang (merah) – dibiarkan pakai variabelmu */} {product?.lowestPrice.priceDiscount > 0 ? ( currencyFormat(product?.lowestPrice.price) @@ -496,13 +485,12 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {/* Chip: ikon + nominal */} - {currencyFormat(discount)} @@ -524,19 +512,6 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )}
)} - - {/* Old */} - {/*
- {product?.stockTotal > 0 && ( -
Ready Stock
- )} -
{product?.stockTotal > 5 ? '> 5' : '< 5'}
- {product?.qtySold > 0 && ( -
- {sellingProductFormat(product?.qtySold) + ' Terjual'} -
- )} -
*/}
-- cgit v1.2.3