From 47f7375e78e7abc37f4d18c32dc485a02f6b9c48 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 23 Oct 2025 14:52:16 +0700 Subject: cr renca --- src/lib/product/components/ProductCard.jsx | 88 +++++++++++++++++----------- src/lib/product/components/ProductSearch.jsx | 18 +++--- 2 files changed, 62 insertions(+), 44 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index a296eff3..801ca8f9 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -80,11 +80,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { <>
- +
{ {/* BOTTOM-LEFT: Varian + PICK UP NOW */} {(product?.variantTotal > 1 || product?.isInBu) && ( -
+
{product?.variantTotal > 1 && ( -
+
{product.variantTotal} Varian
)} + {product?.isInBu && ( Pick Up Now )} @@ -228,8 +234,8 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {product?.flashSale?.id > 0 && product?.lowestPrice.discountPercentage > 0 ? (
-
- +
+ {product?.lowestPrice.priceDiscount > 0 ? ( currencyFormat(product?.lowestPrice.priceDiscount) ) : ( @@ -244,7 +250,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {currencyFormat(product.lowestPrice.price)} @@ -279,11 +285,20 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {discount > 0 && (product?.flashSale?.id ?? 0) < 1 && (
-
- Voucher - - - +
+ {/* label jangan pecah */} + + Voucher + + + {/* chip bisa mengecil & memotong teks di dalam */} + + + {/* nominal: truncate */} + {currencyFormat(discount)} @@ -301,7 +316,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {product?.qtySold > 0 && ( -
+
{sellingProductFormat(product?.qtySold)} Terjual
)} @@ -314,11 +329,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
- +
{ {product?.flashSale?.id > 0 && product?.lowestPrice.discountPercentage > 0 ? (
-
- +
+ {product?.lowestPrice.priceDiscount > 0 ? ( currencyFormat(product?.lowestPrice.priceDiscount) ) : ( @@ -457,7 +468,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {currencyFormat(product.lowestPrice.price)} @@ -492,11 +503,20 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {discount > 0 && (product?.flashSale?.id ?? 0) < 1 && (
-
- Voucher - +
+ {/* label jangan pecah */} + + Voucher + + + {/* chip bisa mengecil & memotong teks di dalam */} + - + {/* nominal: truncate */} + {currencyFormat(discount)} @@ -513,7 +533,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {product?.qtySold > 0 && ( -
+
{sellingProductFormat(product?.qtySold)} Terjual
)} @@ -624,9 +644,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {product?.flashSale?.id > 0 && product?.lowestPrice.discountPercentage > 0 ? (
-
+
{/* harga sekarang (merah) */} - + {product?.lowestPrice.priceDiscount > 0 ? ( currencyFormat(product?.lowestPrice.priceDiscount) // ← perbaikan di sini ) : ( @@ -642,7 +662,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {/* harga lama (abu, dicoret) */} - + {currencyFormat(product.lowestPrice.price)}
@@ -680,7 +700,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { Voucher - + {currencyFormat(discount)} diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index 9503d400..805cc0e0 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -575,16 +575,14 @@ const ProductSearch = ({
)} -
- -
- -
+ +
+
-- cgit v1.2.3