@lookiero/checkout 0.8.22-beta.0 → 0.8.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/infrastructure/delivery/baseBootstrap.d.ts +2 -0
  2. package/dist/infrastructure/delivery/baseBootstrap.js +5 -1
  3. package/dist/infrastructure/delivery/bootstrap.js +2 -0
  4. package/dist/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.d.ts +2 -2
  5. package/dist/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.js +3 -4
  6. package/dist/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -0
  7. package/dist/infrastructure/ui/hooks/useSubmitCheckout.js +3 -3
  8. package/dist/infrastructure/ui/routing/useBasePath.js +2 -2
  9. package/dist/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +5 -3
  10. package/dist/infrastructure/ui/views/item/Item.js +13 -8
  11. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +1 -1
  12. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
  13. package/package.json +1 -1
  14. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +0 -13
  15. package/dist/domain/checkout/command/markCheckoutAsPaid.js +0 -4
  16. package/dist/domain/checkout/model/checkoutPaid.d.ts +0 -13
  17. package/dist/domain/checkout/model/checkoutPaid.js +0 -4
  18. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  19. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  20. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +0 -5
  21. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +0 -13
  22. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +0 -13
  23. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +0 -16
  24. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -13
  25. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +0 -14
  26. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  27. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  28. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
  29. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +0 -9
  30. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
  31. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +0 -12
  32. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +0 -12
  33. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +0 -9
  34. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  35. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  36. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  37. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  38. package/dist/infrastructure/ui/views/App.style.d.ts +0 -4
  39. package/dist/infrastructure/ui/views/App.style.js +0 -16
  40. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  41. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  42. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  43. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  44. package/dist/infrastructure/ui/views/header/Header.d.ts +0 -15
  45. package/dist/infrastructure/ui/views/header/Header.js +0 -90
  46. package/dist/infrastructure/ui/views/header/Header.style.d.ts +0 -35
  47. package/dist/infrastructure/ui/views/header/Header.style.js +0 -38
  48. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +0 -7
  49. package/dist/infrastructure/ui/views/header/components/Logo.js +0 -11
  50. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +0 -7
  51. package/dist/infrastructure/ui/views/header/components/Logo.style.js +0 -8
  52. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  53. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  54. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -55
  55. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -58
  56. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  57. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  58. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  59. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  60. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -10
  61. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +0 -1
  62. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
  63. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
  64. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +0 -25
  65. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +0 -8
  66. package/dist/shared/logging/location.d.ts +0 -3
  67. package/dist/shared/logging/location.js +0 -5
  68. package/dist/shared/logging/matchRoutes.d.ts +0 -3
  69. package/dist/shared/logging/matchRoutes.js +0 -7
  70. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +0 -29
  71. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +0 -134
  72. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +0 -22
  73. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +0 -15
  74. package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +0 -27
  75. package/dist/shared/logging/reactRouterV6Instrumentation.native.js +0 -115
  76. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  77. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  78. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
  79. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +0 -9
  80. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  81. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  82. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  83. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  84. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  85. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  86. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  87. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
@@ -15,6 +15,7 @@ import { CheckoutByIdView } from "../../projection/checkout/viewCheckoutById";
15
15
  import { FirstAvailableCheckoutByCustomerIdView } from "../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
16
16
  import { FiveItemsDiscountByCustomerIdView } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
17
17
  import { IsCheckoutEnabledByCustomerIdView } from "../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
18
+ import { IsSizeChangeEnabledByCheckoutIdView } from "../../projection/checkout/viewIsSizeChangeEnabledByCheckoutId";
18
19
  import { CheckoutBookingByIdView } from "../../projection/checkoutBooking/viewCheckoutBookingById";
19
20
  import { CheckoutItemByIdView } from "../../projection/checkoutItem/viewCheckoutItemById";
20
21
  import { CheckoutQuestionsByCheckoutIdView } from "../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
@@ -29,6 +30,7 @@ interface BaseBootstrapFunctionArgs<UiSettingGetFunctionArgs extends RepositoryG
29
30
  readonly checkoutByIdView: CheckoutByIdView;
30
31
  readonly firstAvailableCheckoutByCustomerIdView: FirstAvailableCheckoutByCustomerIdView;
31
32
  readonly isCheckoutEnabledByCustomerIdView: IsCheckoutEnabledByCustomerIdView;
33
+ readonly isSizeChangeEnabledByCheckoutIdView: IsSizeChangeEnabledByCheckoutIdView;
32
34
  readonly fiveItemsDiscountByCustomerIdView: FiveItemsDiscountByCustomerIdView;
33
35
  readonly uiSettingByKeyView: UiSettingByKeyView;
34
36
  readonly checkoutItemByIdView: CheckoutItemByIdView;
@@ -26,6 +26,7 @@ import { viewFirstAvailableCheckoutByCustomerIdHandler, VIEW_FIRST_AVAILABLE_CHE
26
26
  import { viewFiveItemsDiscountByCustomerIdHandler, VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
27
27
  import { viewIsCheckoutAccessibleByCustomerIdHandler, VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
28
28
  import { viewIsCheckoutEnabledByCustomerIdHandler, VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
29
+ import { viewIsSizeChangeEnabledByCheckoutIdHandler, VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID, } from "../../projection/checkout/viewIsSizeChangeEnabledByCheckoutId";
29
30
  import { viewCheckoutBookingByIdHandler, VIEW_CHECKOUT_BOOKING_BY_ID, } from "../../projection/checkoutBooking/viewCheckoutBookingById";
30
31
  import { viewCheckoutItemByIdHandler, VIEW_CHECKOUT_ITEM_BY_ID, } from "../../projection/checkoutItem/viewCheckoutItemById";
31
32
  import { listCheckoutQuestionsByCheckoutIdHandler, LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID, } from "../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
@@ -36,7 +37,7 @@ import { viewUiSettingByKeyHandler, VIEW_UI_SETTING_BY_KEY, } from "../../projec
36
37
  import { bootstrapWithBuilder as bootstrapNotifications } from "../../shared/notifications/infrastructure/delivery/bootstrap";
37
38
  import { inMemoryStorageNotifications } from "../../shared/notifications/infrastructure/persistence/inMemoryStorageNotifications";
38
39
  const MESSAGING_CONTEXT_ID = "Checkout";
39
- const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdView, isCheckoutEnabledByCustomerIdView, fiveItemsDiscountByCustomerIdView, checkoutItemByIdView, returnQuestionsByCheckoutItemIdView, bookedProductsVariantsForCheckoutItemView, checkoutBookingByIdView, pricingByCheckoutIdView, paymentFlowPayloadByCheckoutIdView, checkoutQuestionsByCheckoutIdView, uiSettingByKeyView, getUiSetting, saveUiSetting, uiSettingsDependencies, getCheckout, saveCheckout, checkoutsDependencies, getCheckoutItem, saveCheckoutItem, checkoutItemsDependencies, getCheckoutBooking, saveCheckoutBooking, checkoutBookingsDependencies, getCheckoutFeedback, saveCheckoutFeedback, checkoutFeedbacksDependencies, }) => {
40
+ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdView, isCheckoutEnabledByCustomerIdView, isSizeChangeEnabledByCheckoutIdView, fiveItemsDiscountByCustomerIdView, checkoutItemByIdView, returnQuestionsByCheckoutItemIdView, bookedProductsVariantsForCheckoutItemView, checkoutBookingByIdView, pricingByCheckoutIdView, paymentFlowPayloadByCheckoutIdView, checkoutQuestionsByCheckoutIdView, uiSettingByKeyView, getUiSetting, saveUiSetting, uiSettingsDependencies, getCheckout, saveCheckout, checkoutsDependencies, getCheckoutItem, saveCheckoutItem, checkoutItemsDependencies, getCheckoutBooking, saveCheckoutBooking, checkoutBookingsDependencies, getCheckoutFeedback, saveCheckoutFeedback, checkoutFeedbacksDependencies, }) => {
40
41
  let messaging = messagingBootstrap({ id: MESSAGING_CONTEXT_ID })
41
42
  .query(VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerIdHandler, {
42
43
  view: fiveItemsDiscountByCustomerIdView,
@@ -49,6 +50,9 @@ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdVie
49
50
  })
50
51
  .query(VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, viewIsCheckoutEnabledByCustomerIdHandler, {
51
52
  view: isCheckoutEnabledByCustomerIdView,
53
+ })
54
+ .query(VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID, viewIsSizeChangeEnabledByCheckoutIdHandler, {
55
+ view: isSizeChangeEnabledByCheckoutIdView,
52
56
  })
53
57
  .query(VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerIdHandler)
54
58
  .command(START_CHECKOUT, startCheckoutHandler)(getCheckout, saveCheckout, ...checkoutsDependencies)
@@ -9,6 +9,7 @@ import { httpCheckoutByIdView } from "../projection/checkout/httpCheckoutByIdVie
9
9
  import { httpFirstAvailableCheckoutByCustomerIdView } from "../projection/checkout/httpFirstAvailableCheckoutByCustomerIdView";
10
10
  import { httpFiveItemsDiscountByCustomerIdView } from "../projection/checkout/httpFiveItemsDiscountByCustomerIdView";
11
11
  import { httpIsCheckoutEnabledByCustomerIdView } from "../projection/checkout/httpIsCheckoutEnabledByCustomerIdView";
12
+ import { httpIsSizeChangeEnabledByCheckoutIdView } from "../projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView";
12
13
  import { httpCheckoutBookingByIdView } from "../projection/checkoutBooking/httpCheckoutBookingByIdView";
13
14
  import { httpCheckoutItemByIdView } from "../projection/checkoutItem/httpCheckoutItemByIdView";
14
15
  import { httpCheckoutQuestionsByCheckoutIdView } from "../projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView";
@@ -25,6 +26,7 @@ const bootstrap = ({ apiUrl, getAuthToken }) => {
25
26
  checkoutByIdView: httpCheckoutByIdView({ httpPost }),
26
27
  firstAvailableCheckoutByCustomerIdView: httpFirstAvailableCheckoutByCustomerIdView({ httpPost }),
27
28
  isCheckoutEnabledByCustomerIdView: httpIsCheckoutEnabledByCustomerIdView({ httpGet }),
29
+ isSizeChangeEnabledByCheckoutIdView: httpIsSizeChangeEnabledByCheckoutIdView({ httpGet }),
28
30
  fiveItemsDiscountByCustomerIdView: httpFiveItemsDiscountByCustomerIdView({ httpGet }),
29
31
  uiSettingByKeyView: storageUiSettingByKeyView({ read }),
30
32
  checkoutItemByIdView: httpCheckoutItemByIdView({ httpPost }),
@@ -1,9 +1,9 @@
1
1
  import { IsSizeChangeEnabledByCheckoutIdView } from "../../../projection/checkout/viewIsSizeChangeEnabledByCheckoutId";
2
- import { HttpPostFunction } from "../../delivery/http/httpClient";
2
+ import { HttpGetFunction } from "../../delivery/http/httpClient";
3
3
  interface HttpIsSizeChangeEnabledByCheckoutIdView extends IsSizeChangeEnabledByCheckoutIdView {
4
4
  }
5
5
  interface HttpIsSizeChangeEnabledByCheckoutIdViewFunctionArgs {
6
- readonly httpPost: HttpPostFunction;
6
+ readonly httpGet: HttpGetFunction;
7
7
  }
8
8
  interface HttpIsSizeChangeEnabledByCheckoutIdViewFunction {
9
9
  (args: HttpIsSizeChangeEnabledByCheckoutIdViewFunctionArgs): HttpIsSizeChangeEnabledByCheckoutIdView;
@@ -1,10 +1,9 @@
1
- const httpIsSizeChangeEnabledByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => await httpPost({
2
- endpoint: "/is-size-change-enabled",
1
+ const httpIsSizeChangeEnabledByCheckoutIdView = ({ httpGet }) => async ({ checkoutId, signal }) => await httpGet({
2
+ endpoint: `/is-size-change-enabled-by-checkout-id/${checkoutId}`,
3
3
  signal,
4
- body: { checkoutId },
5
4
  result: {
6
5
  error: false,
7
- success: (response) => response.result,
6
+ success: (response) => response,
8
7
  },
9
8
  });
10
9
  export { httpIsSizeChangeEnabledByCheckoutIdView };
@@ -5,6 +5,7 @@ import { Logger } from "../../../shared/logging/Logger";
5
5
  type Status = "idle" | "loading" | "success" | "error";
6
6
  interface SubmitCheckoutFunctionArgs {
7
7
  readonly paymentFlowPayload: PaymentFlowPayloadProjection;
8
+ readonly sizeChangeEnabled: boolean;
8
9
  }
9
10
  interface SubmitCheckoutFunction {
10
11
  (args: SubmitCheckoutFunctionArgs): Promise<void>;
@@ -12,9 +12,9 @@ const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onEr
12
12
  const [blockCheckoutBooking, blockCheckoutBookingStatus] = useBlockCheckoutBooking({ checkoutBookingId, logger });
13
13
  const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
14
14
  const [startLegacyBoxCheckoutStatus, setStartLegacyBoxCheckoutStatus] = useState("idle");
15
- const submitCheckout = useCallback(async ({ paymentFlowPayload }) => {
15
+ const submitCheckout = useCallback(async ({ paymentFlowPayload, sizeChangeEnabled }) => {
16
16
  try {
17
- await blockCheckoutBooking();
17
+ sizeChangeEnabled && (await blockCheckoutBooking());
18
18
  }
19
19
  catch (error) {
20
20
  return;
@@ -38,7 +38,7 @@ const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onEr
38
38
  }
39
39
  }
40
40
  });
41
- }, [paymentFlowRef, blockCheckoutBooking, createNotification, submitCheckoutCommand]);
41
+ }, [paymentFlowRef, blockCheckoutBooking, submitCheckoutCommand, createNotification]);
42
42
  const status = useMemo(() => {
43
43
  if (blockCheckoutBookingStatus === CommandStatus.LOADING ||
44
44
  startLegacyBoxCheckoutStatus === "loading" ||
@@ -1,9 +1,9 @@
1
- import { invariant } from "@remix-run/router";
2
1
  import React, { createContext, useContext } from "react";
2
+ import invariant from "tiny-invariant";
3
3
  const BasePathContext = createContext(null);
4
4
  export const BasePathProvider = ({ basePath, children }) => (React.createElement(BasePathContext.Provider, { value: basePath }, children));
5
5
  export const useBasePath = () => {
6
6
  const basePath = useContext(BasePathContext);
7
- invariant(basePath, "Your are trying to use the useBasePath hook without wrapping your app with the <BasePathProvider>.");
7
+ invariant(basePath !== null, "Your are trying to use the useBasePath hook without wrapping your app with the <BasePathProvider>.");
8
8
  return basePath;
9
9
  };
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { useNavigate } from "react-router-native";
5
5
  import { useLogger } from "../../../../../../shared/logging/useLogger";
6
6
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
7
+ import { useViewIsSizeChangeEnabledByCheckoutId } from "../../../../../projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId";
7
8
  import { useViewPaymentFlowPayloadByCheckoutId } from "../../../../../projection/payment/react/useViewPaymentFlowPayloadByCheckoutId";
8
9
  import { useSubmitCheckout } from "../../../../hooks/useSubmitCheckout";
9
10
  import { Routes } from "../../../../routing/routes";
@@ -15,6 +16,7 @@ const CheckoutPaymentModal = ({ customerId, getAuthToken }) => {
15
16
  const [paymentFlowPayload] = useViewPaymentFlowPayloadByCheckoutId({
16
17
  checkoutId: checkout?.id,
17
18
  });
19
+ const [sizeChangeEnabled] = useViewIsSizeChangeEnabledByCheckoutId({ checkoutId: checkout?.id });
18
20
  const [authToken, setAuthToken] = useState();
19
21
  useEffect(() => {
20
22
  const loadAuthToken = async () => setAuthToken(await getAuthToken());
@@ -31,10 +33,10 @@ const CheckoutPaymentModal = ({ customerId, getAuthToken }) => {
31
33
  logger,
32
34
  });
33
35
  useEffect(() => {
34
- if (paymentFlowPayload) {
35
- submitCheckout({ paymentFlowPayload });
36
+ if (paymentFlowPayload && sizeChangeEnabled !== undefined) {
37
+ submitCheckout({ paymentFlowPayload, sizeChangeEnabled });
36
38
  }
37
- }, [paymentFlowPayload, submitCheckout]);
39
+ }, [paymentFlowPayload, sizeChangeEnabled, submitCheckout]);
38
40
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
39
41
  const dependenciesLoaded = (dependenciesLoadedStatuses.includes(checkoutStatus) || checkout) && authToken;
40
42
  if (!dependenciesLoaded)
@@ -14,6 +14,7 @@ import { useResetCheckoutItem } from "../../../domain/checkoutItem/react/useRese
14
14
  import { useReturnCheckoutItem } from "../../../domain/checkoutItem/react/useReturnCheckoutItem";
15
15
  import { useViewBookedProductsVariantsForCheckoutItem } from "../../../projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem";
16
16
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
17
+ import { useViewIsSizeChangeEnabledByCheckoutId } from "../../../projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId";
17
18
  import { useListReturnQuestionsByCheckoutItemId } from "../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
18
19
  import { TrackingPage } from "../../../tracking/tracking";
19
20
  import { Body } from "../../components/layouts/body/Body";
@@ -34,6 +35,9 @@ const Item = ({ customerId, country }) => {
34
35
  const logger = useLogger();
35
36
  const { id } = useParams();
36
37
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
38
+ const [isSizeChangeEnabled, sizeChangeEnabledStatus] = useViewIsSizeChangeEnabledByCheckoutId({
39
+ checkoutId: checkout?.id,
40
+ });
37
41
  const checkoutItem = checkout?.items.find((checkoutItem) => checkoutItem.id === id);
38
42
  usePageView({
39
43
  page: TrackingPage.ITEM,
@@ -58,7 +62,7 @@ const Item = ({ customerId, country }) => {
58
62
  const [sizeWithoutStockModalVisible, setSizeWithoutStockModalVisible] = useState(false);
59
63
  const handleOnShowSizeWithoutStockModal = useCallback(() => setSizeWithoutStockModalVisible(true), []);
60
64
  const handleOnHideSizeWithoutStockModal = useCallback(() => setSizeWithoutStockModalVisible(false), []);
61
- const [bookedProductsVariants, bookedProductsVariantsStatus] = useViewBookedProductsVariantsForCheckoutItem({
65
+ const [bookedProductsVariants] = useViewBookedProductsVariantsForCheckoutItem({
62
66
  checkoutItemId: checkoutItem.id,
63
67
  });
64
68
  const [bookCheckoutBooking] = useBookCheckoutBookingForCheckoutItem({
@@ -66,9 +70,10 @@ const Item = ({ customerId, country }) => {
66
70
  checkoutBookingId: checkout?.checkoutBookingId,
67
71
  logger,
68
72
  });
73
+ const isBookingRequired = bookedProductsVariants === null && isSizeChangeEnabled;
69
74
  useEffect(() => {
70
- bookedProductsVariants === null && bookCheckoutBooking();
71
- }, [bookCheckoutBooking, bookedProductsVariants]);
75
+ isBookingRequired && bookCheckoutBooking();
76
+ }, [bookCheckoutBooking, isBookingRequired]);
72
77
  const [returnQuestions, returnQuestionsStatus] = useListReturnQuestionsByCheckoutItemId({
73
78
  checkoutItemId: checkoutItem.id,
74
79
  });
@@ -89,17 +94,17 @@ const Item = ({ customerId, country }) => {
89
94
  : { id: checkoutItem.productVariant.id, size: checkoutItem.productVariant.size }, [checkoutItem.productVariant.id, checkoutItem.productVariant.size, checkoutItem.replacedFor, checkoutItem.status]);
90
95
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
91
96
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(returnQuestionsStatus) &&
92
- // This will ensure that the view is not shown until bookCheckoutBooking use-case is dispatched
93
- (dependenciesLoadedStatuses.includes(checkoutStatus) || (checkout && checkout.checkoutBookingId)) &&
94
- dependenciesLoadedStatuses.includes(bookedProductsVariantsStatus) &&
95
- bookedProductsVariants;
97
+ dependenciesLoadedStatuses.includes(sizeChangeEnabledStatus) &&
98
+ // This will ensure that the view is not shown until bookCheckoutBooking use-case is dispatched (if required)
99
+ (isBookingRequired ? checkout?.checkoutBookingId && bookedProductsVariants : true) &&
100
+ (dependenciesLoadedStatuses.includes(checkoutStatus) || checkout);
96
101
  if (!dependenciesLoaded)
97
102
  return React.createElement(Spinner, null);
98
103
  const { price } = checkoutItem;
99
104
  const { media, brand, name, color } = checkoutItem.productVariant;
100
105
  return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: checkoutItem.feedbacks || {} },
101
106
  React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
102
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, footer: !customerDecissionMade && (React.createElement(ItemActions, { country: country, keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: keepCheckoutItem, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })) },
107
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, footer: !customerDecissionMade && (React.createElement(ItemActions, { country: country, keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants, returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: keepCheckoutItem, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })) },
103
108
  React.createElement(Body, null,
104
109
  customerDecissionMade && (React.createElement(CustomerDecissionBanner, { changingDecission: resetCheckoutItemStatus === CommandStatus.LOADING, checkoutItemStatus: checkoutItem.status, onPress: resetCheckoutItem })),
105
110
  React.createElement(View, { style: [style.content, { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight }] },
@@ -3,7 +3,7 @@ import { ProductVariantProjection } from "../../../../../../projection/bookedPro
3
3
  import { Country } from "../../../../../../projection/shared/country";
4
4
  import { Layout } from "../../../../../../shared/ui/components/layouts/sticky/Sticky";
5
5
  interface ItemActionsProps {
6
- readonly productVariants: ProductVariantProjection[];
6
+ readonly productVariants?: ProductVariantProjection[];
7
7
  readonly productVariantSelected: ProductVariantProjection;
8
8
  readonly keepButtonLoading?: boolean;
9
9
  readonly returnButtonLoading?: boolean;
@@ -13,7 +13,7 @@ const ItemActions = ({ productVariants, productVariantSelected, keepButtonLoadin
13
13
  const sizeSelectorLabelText = useI18nMessage({ id: I18nMessages.ITEM_SIZES_LABEL });
14
14
  const keepButtonText = useI18nMessage({ id: I18nMessages.ITEM_KEEP_BUTTON });
15
15
  const returnButtonText = useI18nMessage({ id: I18nMessages.ITEM_RETURN_BUTTON });
16
- const sizeSelectorOptions = useMemo(() => productVariants.map((productVariant) => ({
16
+ const sizeSelectorOptions = useMemo(() => (productVariants || []).map((productVariant) => ({
17
17
  label: size({ size: productVariant.size, country }),
18
18
  value: productVariant.id,
19
19
  })), [country, productVariants]);
@@ -23,7 +23,7 @@ const ItemActions = ({ productVariants, productVariantSelected, keepButtonLoadin
23
23
  React.createElement(Body, { style: { column: style.container } },
24
24
  React.createElement(Button, { busy: keepButtonLoading, onPress: onKeep }, keepButtonText),
25
25
  React.createElement(View, { style: style.row },
26
- !productVariantSelected.size.unique && (React.createElement(SelectField, { ...(disabledSizeSelector && {
26
+ !productVariantSelected.size.unique && productVariants && (React.createElement(SelectField, { ...(disabledSizeSelector && {
27
27
  onPress: onSizeSelectorPress,
28
28
  }), disabled: sizeSelectorDisabled, options: sizeSelectorOptions, placeholder: sizeSelectorLabelText || "", testID: "size-selector", title: sizeSelectorLabelText || "", value: productVariantSelected.id, style: {
29
29
  selectField: style.sizeSelector,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.8.22-beta.0",
3
+ "version": "0.8.23",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,13 +0,0 @@
1
- import { Command } from "@lookiero/messaging";
2
- declare const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
- interface MarkCheckoutAsPaidPayload {
4
- readonly aggregateId: string;
5
- }
6
- interface MarkCheckoutAsPaid extends Command<typeof MARK_CHECKOUT_AS_PAID>, MarkCheckoutAsPaidPayload {
7
- }
8
- interface MarkCheckoutAsPaidFunction {
9
- (payload: MarkCheckoutAsPaidPayload): MarkCheckoutAsPaid;
10
- }
11
- declare const markCheckoutAsPaid: MarkCheckoutAsPaidFunction;
12
- export type { MarkCheckoutAsPaid };
13
- export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -1,4 +0,0 @@
1
- import { command } from "@lookiero/messaging";
2
- const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
- const markCheckoutAsPaid = ({ aggregateId }) => command({ aggregateId, name: MARK_CHECKOUT_AS_PAID });
4
- export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -1,13 +0,0 @@
1
- import { DomainEvent } from "@lookiero/messaging";
2
- declare const CHECKOUT_PAID = "checkout_paid";
3
- interface CheckoutPaidPayload {
4
- readonly aggregateId: string;
5
- }
6
- interface CheckoutPaid extends DomainEvent<typeof CHECKOUT_PAID>, CheckoutPaidPayload {
7
- }
8
- interface CheckoutPaidFunction {
9
- (payload: CheckoutPaidPayload): CheckoutPaid;
10
- }
11
- declare const checkoutPaid: CheckoutPaidFunction;
12
- export type { CheckoutPaid };
13
- export { CHECKOUT_PAID, checkoutPaid };
@@ -1,4 +0,0 @@
1
- import { domainEvent } from "@lookiero/messaging";
2
- const CHECKOUT_PAID = "checkout_paid";
3
- const checkoutPaid = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_PAID });
4
- export { CHECKOUT_PAID, checkoutPaid };
@@ -1,6 +0,0 @@
1
- import { ProcessManagerFunction } from "@lookiero/messaging";
2
- import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
3
- interface CreateNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
4
- }
5
- declare const createNotificationWhenCheckoutBookingExpired: CreateNotificationWhenCheckoutBookingExpiredFunction;
6
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,13 +0,0 @@
1
- import { v4 as uuid } from "uuid";
2
- import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
3
- import { createNotification } from "../../../shared/notifications/domain/notification/command/createNotification";
4
- import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
5
- const createNotificationWhenCheckoutBookingExpired = ({ commandBus }) => async () => {
6
- await commandBus(createNotification({
7
- aggregateId: uuid(),
8
- level: NotificationLevel.ERROR,
9
- titleI18nKey: undefined,
10
- bodyI18nKey: I18nMessages.CHECKOUT_TOAST_BOOKING_EXPIRED,
11
- }));
12
- };
13
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,5 +0,0 @@
1
- import { HttpCheckoutsSaveFunction } from "./httpCheckouts";
2
- interface HttpCheckoutsMarkAsPaidFunction extends HttpCheckoutsSaveFunction {
3
- }
4
- declare const httpCheckoutsMarkAsPaid: HttpCheckoutsMarkAsPaidFunction;
5
- export { httpCheckoutsMarkAsPaid };
@@ -1,13 +0,0 @@
1
- import { CHECKOUT_PAID } from "../../../../domain/checkout/model/checkoutPaid";
2
- const isCheckoutPaid = (event) => event.name === CHECKOUT_PAID;
3
- const httpCheckoutsMarkAsPaid = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
4
- const checkoutPaid = domainEvents.find(isCheckoutPaid);
5
- if (!checkoutPaid) {
6
- return;
7
- }
8
- await httpPost({
9
- endpoint: "/mark-checkout-as-paid",
10
- body: { checkoutId: aggregateId },
11
- });
12
- };
13
- export { httpCheckoutsMarkAsPaid };
@@ -1,13 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface MarkAsPaidFunction {
3
- (): Promise<void>;
4
- }
5
- type UseMarkCheckoutAsPaid = [markAsPaid: MarkAsPaidFunction, status: CommandStatus];
6
- interface UseMarkCheckoutAsPaidFunctionArgs {
7
- readonly checkoutId?: string;
8
- }
9
- interface UseMarkCheckoutAsPaidFunction {
10
- (args: UseMarkCheckoutAsPaidFunctionArgs): UseMarkCheckoutAsPaid;
11
- }
12
- declare const useMarkCheckoutAsPaid: UseMarkCheckoutAsPaidFunction;
13
- export { useMarkCheckoutAsPaid };
@@ -1,16 +0,0 @@
1
- import { useCommand } from "@lookiero/messaging-react";
2
- import { useCallback } from "react";
3
- import invariant from "tiny-invariant";
4
- import { markCheckoutAsPaid } from "../../../../domain/checkout/command/markCheckoutAsPaid";
5
- import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
- const useMarkCheckoutAsPaid = ({ checkoutId }) => {
7
- const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
- const markAsPaid = useCallback(() => {
9
- invariant(checkoutId, "CheckoutId must be defined in order to mark the checkout as paid");
10
- return commandBus(markCheckoutAsPaid({
11
- aggregateId: checkoutId,
12
- }));
13
- }, [checkoutId, commandBus]);
14
- return [markAsPaid, status];
15
- };
16
- export { useMarkCheckoutAsPaid };
@@ -1,13 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface BookFunction {
3
- (): Promise<void>;
4
- }
5
- type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
6
- interface UseBookCheckouBookingForCheckoutItemFunctionArgs {
7
- readonly checkoutItemId: string;
8
- }
9
- interface UseBookCheckouBookingForCheckoutItemFunction {
10
- (args: UseBookCheckouBookingForCheckoutItemFunctionArgs): UseBookCheckouBookingForCheckoutItem;
11
- }
12
- declare const useBookCheckouBookingForCheckoutItem: UseBookCheckouBookingForCheckoutItemFunction;
13
- export { useBookCheckouBookingForCheckoutItem };
@@ -1,14 +0,0 @@
1
- import { useCommand } from "@lookiero/messaging-react";
2
- import { useCallback } from "react";
3
- import { v4 as uuid } from "uuid";
4
- import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
5
- import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
- const useBookCheckouBookingForCheckoutItem = ({ checkoutItemId }) => {
7
- const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
- const book = useCallback(() => commandBus(bookCheckoutBookingForCheckoutItem({
9
- aggregateId: uuid(),
10
- checkoutItemId,
11
- })), [checkoutItemId, commandBus]);
12
- return [book, status];
13
- };
14
- export { useBookCheckouBookingForCheckoutItem };
@@ -1,10 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface IncrementIntroShownCountFunction {
3
- (): Promise<void>;
4
- }
5
- type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
6
- interface UseIncrementIntroShownCountFunction {
7
- (): UseIncrementIntroShownCount;
8
- }
9
- declare const useIncrementIntroShownCount: UseIncrementIntroShownCountFunction;
10
- export { useIncrementIntroShownCount };
@@ -1,11 +0,0 @@
1
- import { useCallback } from "react";
2
- import { useViewIntroShownCount } from "../../../projection/uiSetting/react/useViewIntroShownCount";
3
- import { UISettings } from "../../../ui/settings/UISettings";
4
- import { useUpdateUiSetting } from "./useUpdateUiSetting";
5
- const useIncrementIntroShownCount = () => {
6
- const [update, status] = useUpdateUiSetting();
7
- const [introShownCount] = useViewIntroShownCount();
8
- const incrementIntroShownCount = useCallback(() => update({ key: UISettings.INTRO_SHOWN_COUNT, value: introShownCount + 1 }), [introShownCount, update]);
9
- return [incrementIntroShownCount, status];
10
- };
11
- export { useIncrementIntroShownCount };
@@ -1,12 +0,0 @@
1
- import { BookedSizeChangeProductsVariantsForCheckoutItemView } from "../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
2
- import { HttpPostFunction } from "../../delivery/http/httpClient";
3
- interface HttpBookedSizeChangeProductsVariantsForCheckoutItemView extends BookedSizeChangeProductsVariantsForCheckoutItemView {
4
- }
5
- interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs {
6
- readonly httpPost: HttpPostFunction;
7
- }
8
- interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction {
9
- (args: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs): HttpBookedSizeChangeProductsVariantsForCheckoutItemView;
10
- }
11
- declare const httpBookedSizeChangeProductsVariantsForCheckoutItemView: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction;
12
- export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
@@ -1,9 +0,0 @@
1
- const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
2
- const response = await httpPost({
3
- endpoint: "/view-booked-size-change-product-variants-for-checkout-item",
4
- body: { checkoutItemId },
5
- signal,
6
- });
7
- return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
- };
9
- export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
@@ -1,10 +0,0 @@
1
- import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
- import { BookedSizeChangeProductsVariantsProjection } from "../../../../projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants";
3
- interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs {
4
- readonly checkoutItemId: string;
5
- }
6
- interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction {
7
- (args: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs): UseQueryFunctionResult<BookedSizeChangeProductsVariantsProjection>;
8
- }
9
- declare const useViewBookedSizeChangeProductsVariantsForCheckoutItem: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction;
10
- export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
@@ -1,12 +0,0 @@
1
- import { useQuery } from "@lookiero/messaging-react";
2
- import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
- import { viewBookedSizeChangeProductsVariantsForCheckoutItem } from "../../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
4
- import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
- const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
6
- const useViewBookedSizeChangeProductsVariantsForCheckoutItem = ({ checkoutItemId }) => useQuery({
7
- query: viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId }),
8
- contextId: MESSAGING_CONTEXT_ID,
9
- invalidation: isCheckoutBookingBooked,
10
- options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
11
- });
12
- export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
@@ -1,12 +0,0 @@
1
- import { CheckoutFeedbackByCheckoutIdView } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId";
2
- import { HttpPostFunction } from "../../delivery/http/httpClient";
3
- interface HttpCheckoutFeebackByCheckoutIdView extends CheckoutFeedbackByCheckoutIdView {
4
- }
5
- interface HttpCheckoutFeebackByCheckoutIdViewFunctionArgs {
6
- readonly httpPost: HttpPostFunction;
7
- }
8
- interface HttpCheckoutFeebackByCheckoutIdViewFunction {
9
- (args: HttpCheckoutFeebackByCheckoutIdViewFunctionArgs): HttpCheckoutFeebackByCheckoutIdView;
10
- }
11
- declare const httpCheckoutFeebackByCheckoutIdView: HttpCheckoutFeebackByCheckoutIdViewFunction;
12
- export { httpCheckoutFeebackByCheckoutIdView };
@@ -1,9 +0,0 @@
1
- const httpCheckoutFeebackByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => {
2
- const response = await httpPost({
3
- endpoint: "/view-checkout-feedback-by-checkout-id",
4
- body: { checkoutId },
5
- signal,
6
- });
7
- return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
- };
9
- export { httpCheckoutFeebackByCheckoutIdView };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseShouldIntroBeShownFunction {
3
- (): [boolean, QueryStatus];
4
- }
5
- declare const useShouldIntroBeShown: UseShouldIntroBeShownFunction;
6
- export { useShouldIntroBeShown };
@@ -1,7 +0,0 @@
1
- import { useViewIntroShownCount } from "./useViewIntroShownCount";
2
- const MAX_INTRO_SHOWN_COUNT = 2;
3
- const useShouldIntroBeShown = () => {
4
- const [introShownCount, introShownCountStatus] = useViewIntroShownCount();
5
- return [introShownCount < MAX_INTRO_SHOWN_COUNT, introShownCountStatus];
6
- };
7
- export { useShouldIntroBeShown };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseViewIntroShownCountFunction {
3
- (): [number, QueryStatus];
4
- }
5
- declare const useViewIntroShownCount: UseViewIntroShownCountFunction;
6
- export { useViewIntroShownCount };
@@ -1,9 +0,0 @@
1
- import { UISettings } from "../../../ui/settings/UISettings";
2
- import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
3
- const useViewIntroShownCount = () => {
4
- const [introShownCount, introShownCountStatus] = useViewUiSettingByKey({
5
- key: UISettings.INTRO_SHOWN_COUNT,
6
- });
7
- return [introShownCount?.value || 0, introShownCountStatus];
8
- };
9
- export { useViewIntroShownCount };
@@ -1,4 +0,0 @@
1
- declare const style: {
2
- header: {};
3
- };
4
- export { style };
@@ -1,16 +0,0 @@
1
- import { Platform, StyleSheet } from "react-native";
2
- const style = StyleSheet.create({
3
- header: {
4
- ...Platform.select({
5
- web: {
6
- position: "fixed",
7
- zIndex: 1,
8
- },
9
- native: {
10
- position: "absolute",
11
- zIndex: 1,
12
- },
13
- }),
14
- },
15
- });
16
- export { style };
@@ -1,7 +0,0 @@
1
- import { FC } from "react";
2
- interface CheckoutSuccessModalProps {
3
- readonly visible: boolean;
4
- readonly onDismiss: () => void;
5
- }
6
- declare const CheckoutSuccessModal: FC<CheckoutSuccessModalProps>;
7
- export { CheckoutSuccessModal };