diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-12 17:12:31 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-12 17:12:31 +0700 |
| commit | 9aeb019257787b355f7b51f401d7f417899252f5 (patch) | |
| tree | d159c7da9195d4ad058eb0fb9cfa72b1e86baa30 /src/pages/shop/checkout.js | |
| parent | 3770bcca65e85af7273a3f565b3ca616f852e936 (diff) | |
form validation, fix cart, fix checkout, create address
Diffstat (limited to 'src/pages/shop/checkout.js')
| -rw-r--r-- | src/pages/shop/checkout.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/pages/shop/checkout.js b/src/pages/shop/checkout.js index 5eef98e5..54f93c44 100644 --- a/src/pages/shop/checkout.js +++ b/src/pages/shop/checkout.js @@ -30,7 +30,6 @@ export default function Checkout() { const [totalPriceBeforeTax, setTotalPriceBeforeTax] = useState(0); const [totalTaxAmount, setTotalTaxAmount] = useState(0); const [totalDiscountAmount, setTotalDiscountAmount] = useState(0); - const [isLoading, setIsLoading] = useState(true); const [finishCheckout, setFinishCheckout] = useState(null); const payments = [ @@ -106,10 +105,6 @@ export default function Checkout() { } }, [products]); - useEffect(() => { - if (addresses && products) setIsLoading(false); - }, [addresses, products]); - const submit = async () => { if (!selectedPayment) { toast.error('Mohon pilih metode pembayaran terlebih dahulu', { @@ -151,11 +146,11 @@ export default function Checkout() { </div> ) : ( <> - {isLoading && ( + { !products && !addresses && ( <div className="flex justify-center items-center gap-x-3 mt-14"> <Spinner className="w-10 text-gray_r-8 fill-gray_r-12" /> </div> - )} + ) } { products && addresses && ( <> |
