summaryrefslogtreecommitdiff
path: root/src/lib/cart/components
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-20 12:00:29 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-20 12:00:29 +0700
commit58ab91f8a99a79e0dbae33cf71830e4d1646e264 (patch)
tree61b23a12f741cce31aea0ad006455d116e028bea /src/lib/cart/components
parent525166e62b793b351d1a6be2421c0a33b22f7b7b (diff)
cart refactor
Diffstat (limited to 'src/lib/cart/components')
-rw-r--r--src/lib/cart/components/Cart.jsx19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx
index 69b4ded4..0b6ea768 100644
--- a/src/lib/cart/components/Cart.jsx
+++ b/src/lib/cart/components/Cart.jsx
@@ -204,7 +204,10 @@ const Cart = () => {
<div className="sticky bottom-0 left-0 w-full p-4 mt-6 border-t border-gray_r-6 bg-white">
<div className="flex justify-between mb-4">
<div className="text-gray_r-11">
- Total: <span className="text-red_r-11 font-semibold">{ currencyFormat(totalPriceBeforeTax - totalDiscountAmount + totalTaxAmount) }</span>
+ Total:
+ <span className="text-red_r-11 font-semibold">
+ { selectedProduct().length > 0 ? currencyFormat(totalPriceBeforeTax - totalDiscountAmount + totalTaxAmount) : ' - ' }
+ </span>
</div>
</div>
<div className="flex gap-x-3">
@@ -235,20 +238,20 @@ const Cart = () => {
<div className="leading-7 text-gray_r-12/80">
Apakah anda yakin menghapus barang <span className="underline">{deleteConfirmation?.name}</span> dari keranjang?
</div>
- <div className="flex mt-6 mb-2 gap-x-4">
+ <div className="flex mt-6 gap-x-4">
<button
- className="btn-light flex-1"
+ className="btn-solid-red flex-1"
type="button"
- onClick={() => setDeleteConfirmation(null)}
+ onClick={() => deleteProduct(deleteConfirmation?.id)}
>
- Batal
+ Ya, Hapus
</button>
<button
- className="btn-solid-red flex-1"
+ className="btn-light flex-1"
type="button"
- onClick={() => deleteProduct(deleteConfirmation?.id)}
+ onClick={() => setDeleteConfirmation(null)}
>
- Ya, Hapus
+ Batal
</button>
</div>
</BottomPopup>