From 0d4278bd482d2ec2563b29cb3597eb8c7227a2d7 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Fri, 15 Nov 2024 13:32:26 +0700 Subject: add hook state --- src/lib/checkout/components/Checkout.jsx | 13 ------------- src/lib/checkout/stores/stateCheckout.js | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) create mode 100644 src/lib/checkout/stores/stateCheckout.js (limited to 'src') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 152b84ed..4dd715d7 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -662,19 +662,6 @@ const Checkout = () => { )}
- {/* {!loadingVoucher && - listVouchers?.length === 1 && - listVoucherShippings?.length === 1} - { -
-
-

Tidak ada voucher tersedia

-

- Maaf, saat ini tidak ada voucher yang tersedia. -

-
-
- } */} {listVoucherShippings && listVoucherShippings?.length > 0 && (
diff --git a/src/lib/checkout/stores/stateCheckout.js b/src/lib/checkout/stores/stateCheckout.js new file mode 100644 index 00000000..5d2904dd --- /dev/null +++ b/src/lib/checkout/stores/stateCheckout.js @@ -0,0 +1,11 @@ +import { create } from "zustand"; + +export const stateCheckout = create((set) => ({ + checkWeigth : false, + hasFlashSale : false, + checkoutValidation : false, + setCheckWeigth : (checkWeigth) => set({ checkWeigth }), + setHasFlashSale : (hasFlashSale) => set({ hasFlashSale }), + setCheckoutValidation : (checkoutValidation) => set({ checkoutValidation }), + +})) \ No newline at end of file -- cgit v1.2.3