summaryrefslogtreecommitdiff
path: root/src/lib/checkout/components/Checkout.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/checkout/components/Checkout.jsx')
-rw-r--r--src/lib/checkout/components/Checkout.jsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index 33cfaa87..92a94834 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -34,6 +34,7 @@ import ExpedisiList from '../api/ExpedisiList';
import { getVoucher } from '../api/getVoucher';
import { useAddress } from '../stores/useAdress';
import SectionExpedition from './SectionExpedition';
+import { useCheckout } from '../stores/stateCheckout';
const SELF_PICKUP_ID = 32;
@@ -125,7 +126,6 @@ const Checkout = () => {
}
}, [addresses]);
- const [products, setProducts] = useState(null);
const [totalWeight, setTotalWeight] = useState(0);
const [priceCheck, setPriceCheck] = useState(false);
const [listExpedisi, setExpedisi] = useState([]);
@@ -133,8 +133,6 @@ const Checkout = () => {
const [selectedExpedisi, setSelectedExpedisi] = useState(0);
const [selectedCarrierId, setselectedCarrierId] = useState(0);
const [selectedCarrier, setselectedCarrier] = useState(0);
- const [biayaKirim, setBiayaKirim] = useState(0);
- const [checkWeigth, setCheckWeight] = useState(false);
const [selectedServiceType, setSelectedServiceType] = useState(null);
const [selectedExpedisiService, setselectedExpedisiService] = useState(null);
const [etd, setEtd] = useState(null);
@@ -149,11 +147,11 @@ const Checkout = () => {
const [findCodeVoucher, SetFindVoucher] = useState(null);
const [selisihHargaCode, SetSelisihHargaCode] = useState(null);
const [buttonTerapkan, SetButtonTerapkan] = useState(false);
- const [checkoutValidation, setCheckoutValidation] = useState(false);
const [loadingVoucher, setLoadingVoucher] = useState(true);
const [loadingRajaOngkir, setLoadingRajaOngkir] = useState(false);
const [grandTotal, setGrandTotal] = useState(0);
- const [hasFlashSale, setHasFlashSale] = useState(false);
+
+ const {checkWeigth, setCheckWeight, hasFlashSale, setHasFlashSale, checkoutValidation, setCheckoutValidation, biayaKirim, setBiayaKirim, products, setProducts} = useCheckout();
const expedisiValidation = useRef(null);
@@ -571,6 +569,9 @@ const Checkout = () => {
cartCheckout?.discountVoucher +
(cartCheckout?.discountVoucherShipping || 0);
+
+ console.log('etd', etd, calculateEstimatedArrival(etd), splitDuration(etd));
+
return (
<>
<BottomPopup