summaryrefslogtreecommitdiff
path: root/src/lib/product/components/ProductCard.jsx
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-12-05 02:59:30 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-12-05 02:59:30 +0000
commit80caa8f6ad5fecc213fd1533b972c6173102721e (patch)
treef70c8ec03cf2a1cdb8eb3f30ecd83e200986b70b /src/lib/product/components/ProductCard.jsx
parenteca358fd93f1ea5d88c6a6fcc315624cc3bbb910 (diff)
parent4ac372ff318ee78e5d5019a1dbe95bf47b661766 (diff)
Merged in Feature/popup_information (pull request #118)
Feature/popup information
Diffstat (limited to 'src/lib/product/components/ProductCard.jsx')
-rw-r--r--src/lib/product/components/ProductCard.jsx31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx
index 9500a3fd..fa555bcf 100644
--- a/src/lib/product/components/ProductCard.jsx
+++ b/src/lib/product/components/ProductCard.jsx
@@ -12,6 +12,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
const callForPriceWhatsapp = whatsappUrl('product', {
name: product.name,
+ manufacture: product.manufacture?.name,
url: createSlug('/shop/product/', product.name, product.id, true)
})
@@ -41,7 +42,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
<div className='flex gap-x-1 items-center p-2 justify-center'>
<div className='bg-yellow-400 rounded-lg p-1 h-6 w-19 flex items-center justify-center '>
<span className='text-sm font-bold text-black'>
- {product?.lowestPrice.discountPercentage}%
+ {Math.floor(product?.lowestPrice.discountPercentage)}%
</span>
</div>
<div className='bg-red-600 border border-solid border-yellow-400 p-2 rounded-full h-6 flex w-fit items-center justify-center gap-x-2'>
@@ -102,7 +103,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.lowestPrice.priceDiscount > 0 ? (
currencyFormat(product?.lowestPrice.priceDiscount)
) : (
- <a href={callForPriceWhatsapp}>Call for Inquiry</a>
+ <a rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp}>
+ Call for Inquiry
+ </a>
)}
</div>
</>
@@ -117,7 +120,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
</div>
</>
) : (
- <a href={callForPriceWhatsapp}>Call for Inquiry</a>
+ <a rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp}>
+ Call for Inquiry
+ </a>
)}
</div>
)}
@@ -125,7 +130,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
<div className='flex w-full items-center gap-x-1 '>
{product?.stockTotal > 0 && <div className='badge-solid-red'>Ready Stock</div>}
{/* <div className='badge-gray'>{product?.stockTotal > 5 ? '> 5' : '< 5'}</div> */}
- {product?.qtySold > 0 && <div className='text-gray_r-9 text-[11px]'>{sellingProductFormat(product?.qtySold) + ' Terjual'}</div>}
+ {product?.qtySold > 0 && (
+ <div className='text-gray_r-9 text-[11px]'>
+ {sellingProductFormat(product?.qtySold) + ' Terjual'}
+ </div>
+ )}
</div>
</div>
</div>
@@ -205,7 +214,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.lowestPrice?.priceDiscount > 0 ? (
currencyFormat(product?.lowestPrice?.priceDiscount)
) : (
- <a href={callForPriceWhatsapp}>Call for Inquiry</a>
+ <a rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp}>
+ Call for Inquiry
+ </a>
)}
</div>
</>
@@ -220,7 +231,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
</div>
</>
) : (
- <a href={callForPriceWhatsapp}>Call for Inquiry</a>
+ <a rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp}>
+ Call for Inquiry
+ </a>
)}
</div>
)}
@@ -228,7 +241,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
<div className='flex w-full items-center gap-x-1 '>
{product?.stockTotal > 0 && <div className='badge-solid-red'>Ready Stock</div>}
{/* <div className='badge-gray'>{product?.stockTotal > 5 ? '> 5' : '< 5'}</div> */}
- {product?.qtySold > 0 && <div className='text-gray_r-9 text-[11px]'>{sellingProductFormat(product?.qtySold) + ' Terjual'}</div>}
+ {product?.qtySold > 0 && (
+ <div className='text-gray_r-9 text-[11px]'>
+ {sellingProductFormat(product?.qtySold) + ' Terjual'}
+ </div>
+ )}
</div>
</div>
</div>