summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-10-23 11:48:52 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-10-23 11:48:52 +0700
commitbb953ad18e9040e009d93dff772b792ade6b11f2 (patch)
tree2570ed75eb8abb976e285f598c55f0675825eda4
parentaa9095187a0678940efa2a5db82ac6c883d1d6ac (diff)
<Miqdad> price desktop
-rw-r--r--src/lib/product/components/ProductCard.jsx56
1 files changed, 25 insertions, 31 deletions
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx
index 5908f1ee..7c47a10d 100644
--- a/src/lib/product/components/ProductCard.jsx
+++ b/src/lib/product/components/ProductCard.jsx
@@ -224,42 +224,36 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.flashSale?.id > 0 &&
product?.lowestPrice.discountPercentage > 0 ? (
- <>
- <div className='flex gap-x-1 mb-1 items-center'>
- <div className='text-gray_r-11 line-through text-[11px] sm:text-caption-2'>
+ <div className='mb-2'>
+ <div className='flex items-baseline gap-2 min-w-0'>
+ <span className='text-danger-500 font-semibold tabular-nums whitespace-nowrap'>
+ {product?.lowestPrice.priceDiscount > 0 ? (
+ currencyFormat(product?.lowestPrice.priceDiscount)
+ ) : (
+ <a
+ rel='noopener noreferrer'
+ target='_blank'
+ href={callForPriceWhatsapp}
+ aria-label='Call for Inquiry'
+ >
+ Call for Inquiry
+ </a>
+ )}
+ </span>
+ <span
+ className='text-gray_r-11 line-through text-[11px] sm:text-caption-2 tabular-nums
+ whitespace-nowrap overflow-hidden text-ellipsis max-w-[40%]'
+ >
{currencyFormat(product.lowestPrice.price)}
- </div>
- </div>
- <div className='text-danger-500 font-semibold mb-2'>
- {product?.lowestPrice.priceDiscount > 0 ? (
- <>
- {currencyFormat(product?.lowestPrice.priceDiscount)}
- <div className='text-gray_r-9 text-[10px] font-normal mt-2'>
- Include PPN:{' '}
- {currencyFormat(
- product.lowestPrice.priceDiscount *
- process.env.NEXT_PUBLIC_PPN
- )}
- </div>
- </>
- ) : (
- <a
- rel='noopener noreferrer'
- target='_blank'
- href={callForPriceWhatsapp}
- aria-label='Call for Inquiry'
- >
- Call for Inquiry
- </a>
- )}
+ </span>
</div>
- </>
+ </div>
) : (
- <div className='text-danger-500 font-semibold mb-2 min-h-[40px]'>
+ <div className='text-danger-500 font-semibold mb-2'>
{product?.lowestPrice.price > 0 ? (
<>
- {currencyFormat(product?.lowestPrice.price)}
- <div className='text-gray_r-9 text-[10px] font-normal mt-2'>
+ {currencyFormat(product?.lowestPrice.priceDiscount)}
+ <div className='text-gray_r-9 text-[10px] font-normal'>
Include PPN:{' '}
{currencyFormat(
product.lowestPrice.price *