diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-18 16:24:54 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-18 16:24:54 +0700 |
| commit | 5ac82c38ed3ec4db1fe4ae96e7493a55154716ef (patch) | |
| tree | f493df6c4c9d96b6efa86896fd6d27d2995726c4 /src-migrate/modules/product-detail/components/PriceAction.tsx | |
| parent | 7298d8e811a68cb92c02a7d810f412498d1609d8 (diff) | |
Update product detail page
Diffstat (limited to 'src-migrate/modules/product-detail/components/PriceAction.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/PriceAction.tsx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx index cade21b8..f25847a5 100644 --- a/src-migrate/modules/product-detail/components/PriceAction.tsx +++ b/src-migrate/modules/product-detail/components/PriceAction.tsx @@ -29,13 +29,25 @@ const PriceAction = ({ product }: Props) => { <div className='block md:sticky top-[150px] bg-white py-0 md:py-6 z-10' id='price-section'> {!!activePrice && activePrice.price > 0 && ( <> - <div className={style['main-price']}> - Rp {formatCurrency(activePrice.price || 0)} + <div className='flex items-end gap-x-2'> + {activePrice.discount_percentage > 0 && ( + <> + <div className={style['disc-badge']}> + {Math.floor(activePrice.discount_percentage)}% + </div> + <div className={style['disc-price']}> + Rp {formatCurrency(activePrice.price || 0)} + </div> + </> + )} + <div className={style['main-price']}> + Rp {formatCurrency(activePrice.price_discount || 0)} + </div> </div> <div className='h-1' /> <div className={style['secondary-text']}> Termasuk PPN: {' '} - Rp {formatCurrency(Math.round(activePrice.price * 1.11))} + Rp {formatCurrency(Math.round(activePrice.price_discount * 1.11))} </div> </> )} |
