@lookiero/checkout 0.4.1 → 0.4.3

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 (60) hide show
  1. package/dist/infrastructure/delivery/baseBootstrap.d.ts +2 -2
  2. package/dist/infrastructure/delivery/baseBootstrap.js +4 -4
  3. package/dist/infrastructure/delivery/bootstrap.js +2 -2
  4. package/dist/infrastructure/delivery/mock/dataSourceCheckoutBookings.js +2 -2
  5. package/dist/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.d.ts +12 -0
  6. package/dist/infrastructure/projection/{bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js → bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.js} +2 -2
  7. package/dist/infrastructure/projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem.d.ts +10 -0
  8. package/dist/infrastructure/projection/{bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js → bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem.js} +4 -4
  9. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +1 -2
  10. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +1 -2
  11. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +1 -2
  12. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.d.ts +1 -1
  13. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +3 -3
  14. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +1 -5
  15. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +1 -2
  16. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -3
  17. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +2 -3
  18. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
  19. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +4 -10
  20. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -2
  21. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +1 -0
  22. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +3 -5
  23. package/dist/infrastructure/ui/i18n/i18n.d.ts +3 -6
  24. package/dist/infrastructure/ui/i18n/i18n.js +3 -6
  25. package/dist/infrastructure/ui/views/App.js +1 -3
  26. package/dist/infrastructure/ui/views/App.style.d.ts +0 -5
  27. package/dist/infrastructure/ui/views/App.style.js +0 -7
  28. package/dist/infrastructure/ui/views/checkout/Checkout.js +2 -1
  29. package/dist/infrastructure/ui/views/checkout/Checkout.style.d.ts +1 -0
  30. package/dist/infrastructure/ui/views/checkout/Checkout.style.js +1 -0
  31. package/dist/infrastructure/ui/views/feedback/Feedback.js +2 -1
  32. package/dist/infrastructure/ui/views/header/Header.style.d.ts +2 -1
  33. package/dist/infrastructure/ui/views/header/Header.style.js +3 -2
  34. package/dist/infrastructure/ui/views/intro/Intro.js +2 -1
  35. package/dist/infrastructure/ui/views/item/Item.js +13 -10
  36. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +1 -1
  37. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  38. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +3 -6
  39. package/dist/infrastructure/ui/views/summary/Summary.js +5 -2
  40. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +2 -2
  41. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +3 -0
  42. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +3 -0
  43. package/dist/projection/{bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts → bookedProductsVariants/bookedProductsVariants.d.ts} +2 -2
  44. package/dist/projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem.d.ts +25 -0
  45. package/dist/projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem.js +8 -0
  46. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +9 -4
  47. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +19 -11
  48. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +12 -10
  49. package/dist/shared/ui/components/layouts/modal/Modal.js +9 -5
  50. package/dist/shared/ui/components/layouts/modal/Modal.style.d.ts +3 -0
  51. package/dist/shared/ui/components/layouts/modal/Modal.style.js +1 -0
  52. package/dist/shared/ui/components/layouts/sticky/Sticky.style.js +1 -1
  53. package/dist/shared/ui/components/molecules/buttonIcon/ButtonIcon.style.d.ts +1 -0
  54. package/dist/shared/ui/components/molecules/buttonIcon/ButtonIcon.style.js +1 -0
  55. package/package.json +2 -2
  56. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
  57. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
  58. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
  59. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
  60. /package/dist/projection/{bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js → bookedProductsVariants/bookedProductsVariants.js} +0 -0
@@ -10,7 +10,7 @@ import { CheckoutItem } from "../../domain/checkoutItem/model/checkoutItem";
10
10
  import { CheckoutItemsGetFunction, CheckoutItemsSaveFunction } from "../../domain/checkoutItem/model/checkoutItems";
11
11
  import { UiSetting } from "../../domain/uiSetting/model/uiSetting";
12
12
  import { UiSettingGetFunction, UiSettingSaveFunction } from "../../domain/uiSetting/model/uiSettings";
13
- import { BookedSizeChangeProductsVariantsForCheckoutItemView } from "../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
13
+ import { BookedProductsVariantsForCheckoutItemView } from "../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
14
14
  import { CheckoutByIdView } from "../../projection/checkout/viewCheckoutById";
15
15
  import { FirstAvailableCheckoutByCustomerIdView } from "../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
16
16
  import { FiveItemsDiscountByCustomerIdView } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
@@ -34,7 +34,7 @@ interface BaseBootstrapFunctionArgs<UiSettingGetFunctionArgs extends RepositoryG
34
34
  readonly checkoutItemByIdView: CheckoutItemByIdView;
35
35
  readonly checkoutBookingByIdView: CheckoutBookingByIdView;
36
36
  readonly returnQuestionsByCheckoutItemIdView: ReturnQuestionsByCheckoutItemIdView;
37
- readonly bookedSizeChangeProductsVariantsForCheckoutItemView: BookedSizeChangeProductsVariantsForCheckoutItemView;
37
+ readonly bookedProductsVariantsForCheckoutItemView: BookedProductsVariantsForCheckoutItemView;
38
38
  readonly pricingByCheckoutIdView: PricingByCheckoutIdView;
39
39
  readonly paymentFlowPayloadByCheckoutIdView: PaymentFlowPayloadByCheckoutIdView;
40
40
  readonly checkoutQuestionsByCheckoutIdView: CheckoutQuestionsByCheckoutIdView;
@@ -13,7 +13,7 @@ import { RETURN_CHECKOUT_ITEM } from "../../domain/checkoutItem/command/returnCh
13
13
  import { keepCheckoutItemHandler, replaceCheckoutItemHandler, returnCheckoutItemHandler, } from "../../domain/checkoutItem/model/checkoutItem";
14
14
  import { UPDATE_UI_SETTING } from "../../domain/uiSetting/command/updateUiSetting";
15
15
  import { updateUiSettingHandler } from "../../domain/uiSetting/model/uiSetting";
16
- import { viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, } from "../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
16
+ import { viewBookedProductsVariantsForCheckoutItemHandler, VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, } from "../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
17
17
  import { viewCheckoutByIdHandler, VIEW_CHECKOUT_BY_ID, } from "../../projection/checkout/viewCheckoutById";
18
18
  import { viewFirstAvailableCheckoutByCustomerIdHandler, VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID, } from "../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
19
19
  import { viewFiveItemsDiscountByCustomerIdHandler, VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
@@ -27,7 +27,7 @@ import { viewPricingByCheckoutIdHandler, VIEW_PRICING_BY_CHECKOUT_ID, } from "..
27
27
  import { listReturnQuestionsByCheckoutItemIdHandler, LIST_RETURN_QUESTIONS_BY_CHECKOUT_ITEM_ID, } from "../../projection/returnQuestion/listReturnQuestionsByCheckoutItemId";
28
28
  import { viewUiSettingByKeyHandler, VIEW_UI_SETTING_BY_KEY, } from "../../projection/uiSetting/viewUiSettingByKey";
29
29
  const MESSAGING_CONTEXT_ID = "Checkout";
30
- const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdView, isCheckoutEnabledByCustomerIdView, fiveItemsDiscountByCustomerIdView, uiSettingByKeyView, checkoutItemByIdView, returnQuestionsByCheckoutItemIdView, bookedSizeChangeProductsVariantsForCheckoutItemView, checkoutBookingByIdView, pricingByCheckoutIdView, paymentFlowPayloadByCheckoutIdView, checkoutQuestionsByCheckoutIdView, getUiSetting, saveUiSetting, uiSettingsDependencies, getCheckout, saveCheckout, checkoutsDependencies, getCheckoutItem, saveCheckoutItem, checkoutItemsDependencies, getCheckoutBooking, saveCheckoutBooking, checkoutBookingsDependencies, getCheckoutFeedback, saveCheckoutFeedback, checkoutFeedbacksDependencies, }) => messagingBootstrap({ id: MESSAGING_CONTEXT_ID })
30
+ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdView, isCheckoutEnabledByCustomerIdView, fiveItemsDiscountByCustomerIdView, uiSettingByKeyView, checkoutItemByIdView, returnQuestionsByCheckoutItemIdView, bookedProductsVariantsForCheckoutItemView, checkoutBookingByIdView, pricingByCheckoutIdView, paymentFlowPayloadByCheckoutIdView, checkoutQuestionsByCheckoutIdView, getUiSetting, saveUiSetting, uiSettingsDependencies, getCheckout, saveCheckout, checkoutsDependencies, getCheckoutItem, saveCheckoutItem, checkoutItemsDependencies, getCheckoutBooking, saveCheckoutBooking, checkoutBookingsDependencies, getCheckoutFeedback, saveCheckoutFeedback, checkoutFeedbacksDependencies, }) => messagingBootstrap({ id: MESSAGING_CONTEXT_ID })
31
31
  .query(VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerIdHandler, {
32
32
  view: fiveItemsDiscountByCustomerIdView,
33
33
  })
@@ -64,8 +64,8 @@ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdVie
64
64
  .query(VIEW_CHECKOUT_BOOKING_BY_ID, viewCheckoutBookingByIdHandler, {
65
65
  view: checkoutBookingByIdView,
66
66
  })
67
- .query(VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, {
68
- view: bookedSizeChangeProductsVariantsForCheckoutItemView,
67
+ .query(VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedProductsVariantsForCheckoutItemHandler, {
68
+ view: bookedProductsVariantsForCheckoutItemView,
69
69
  })
70
70
  .command(BOOK_CHECKOUT_BOOKING_FOR_CHECKOUT_ITEM, bookCheckoutBookingForCheckoutItemHandler)(getCheckoutBooking, saveCheckoutBooking, ...checkoutBookingsDependencies)
71
71
  .command(BLOCK_CHECKOUT_BOOKING, blockCheckoutBookingHandler)(getCheckoutBooking, saveCheckoutBooking, ...checkoutBookingsDependencies)
@@ -4,7 +4,7 @@ import { getCheckoutFeedback, saveCheckoutFeedback } from "../domain/checkoutFee
4
4
  import { getCheckoutItem, saveCheckoutItem } from "../domain/checkoutItem/model/httpCheckoutItems";
5
5
  import { getUiSetting, saveUiSetting } from "../domain/uiSetting/model/storageUiSettings";
6
6
  import { read, write } from "../persistence/asyncStorageStorage";
7
- import { httpBookedSizeChangeProductsVariantsForCheckoutItemView } from "../projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView";
7
+ import { httpBookedProductsVariantsForCheckoutItemView } from "../projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView";
8
8
  import { httpCheckoutByIdView } from "../projection/checkout/httpCheckoutByIdView";
9
9
  import { httpFirstAvailableCheckoutByCustomerIdView } from "../projection/checkout/httpFirstAvailableCheckoutByCustomerIdView";
10
10
  import { httpFiveItemsDiscountByCustomerIdView } from "../projection/checkout/httpFiveItemsDiscountByCustomerIdView";
@@ -30,7 +30,7 @@ const bootstrap = ({ apiUrl, getAuthToken }) => {
30
30
  checkoutItemByIdView: httpCheckoutItemByIdView({ httpPost }),
31
31
  returnQuestionsByCheckoutItemIdView: httpReturnQuestionsByCheckoutItemIdView({ httpPost }),
32
32
  checkoutBookingByIdView: httpCheckoutBookingByIdView({ httpPost }),
33
- bookedSizeChangeProductsVariantsForCheckoutItemView: httpBookedSizeChangeProductsVariantsForCheckoutItemView({
33
+ bookedProductsVariantsForCheckoutItemView: httpBookedProductsVariantsForCheckoutItemView({
34
34
  httpPost,
35
35
  }),
36
36
  pricingByCheckoutIdView: httpPricingByCheckoutIdView({
@@ -1,7 +1,7 @@
1
1
  import invariant from "tiny-invariant";
2
2
  import { v4 as uuid } from "uuid";
3
3
  import { CheckoutStatus } from "../../../domain/checkout/model/checkout";
4
- import { viewBookedSizeChangeProductsVariantsForCheckoutItem, } from "../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
4
+ import { viewBookedProductsVariantsForCheckoutItem, } from "../../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
5
5
  const toCheckoutBookingDomain = (checkoutBooking) => {
6
6
  invariant(checkoutBooking, "No checkoutBooking found!");
7
7
  return {
@@ -16,7 +16,7 @@ const toCheckoutBookingProjection = (checkoutBooking) => ({
16
16
  checkoutItemIds: checkoutBooking.checkoutItemIds,
17
17
  checkoutStatus: checkoutBooking.checkoutStatus,
18
18
  });
19
- const getCheckoutBooking = ({ queryBus }) => async (aggregateId) => toCheckoutBookingDomain(await queryBus(viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId: aggregateId })));
19
+ const getCheckoutBooking = ({ queryBus }) => async (aggregateId) => toCheckoutBookingDomain(await queryBus(viewBookedProductsVariantsForCheckoutItem({ checkoutItemId: aggregateId })));
20
20
  const saveCheckoutBooking = ({ dataSource }) => async (aggregateRoot) => {
21
21
  dataSource.saveCheckoutBooking(toCheckoutBookingProjection(aggregateRoot));
22
22
  };
@@ -0,0 +1,12 @@
1
+ import { BookedProductsVariantsForCheckoutItemView } from "../../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
2
+ import { HttpPostFunction } from "../../delivery/http/httpClient";
3
+ interface HttpBookedProductsVariantsForCheckoutItemView extends BookedProductsVariantsForCheckoutItemView {
4
+ }
5
+ interface HttpBookedProductsVariantsForCheckoutItemViewFunctionArgs {
6
+ readonly httpPost: HttpPostFunction;
7
+ }
8
+ interface HttpBookedProductsVariantsForCheckoutItemViewFunction {
9
+ (args: HttpBookedProductsVariantsForCheckoutItemViewFunctionArgs): HttpBookedProductsVariantsForCheckoutItemView;
10
+ }
11
+ declare const httpBookedProductsVariantsForCheckoutItemView: HttpBookedProductsVariantsForCheckoutItemViewFunction;
12
+ export { httpBookedProductsVariantsForCheckoutItemView };
@@ -1,4 +1,4 @@
1
- const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
1
+ const httpBookedProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
2
2
  const response = await httpPost({
3
3
  endpoint: "/view-booked-product-variants-for-checkout-item",
4
4
  body: { checkoutItemId },
@@ -6,4 +6,4 @@ const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) =
6
6
  });
7
7
  return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
8
  };
9
- export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
9
+ export { httpBookedProductsVariantsForCheckoutItemView };
@@ -0,0 +1,10 @@
1
+ import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
+ import { BookedProductsVariantsProjection } from "../../../../projection/bookedProductsVariants/bookedProductsVariants";
3
+ interface UseViewBookedProductsVariantsForCheckoutItemFunctionArgs {
4
+ readonly checkoutItemId: string;
5
+ }
6
+ interface UseViewBookedProductsVariantsForCheckoutItemFunction {
7
+ (args: UseViewBookedProductsVariantsForCheckoutItemFunctionArgs): UseQueryFunctionResult<BookedProductsVariantsProjection>;
8
+ }
9
+ declare const useViewBookedProductsVariantsForCheckoutItem: UseViewBookedProductsVariantsForCheckoutItemFunction;
10
+ export { useViewBookedProductsVariantsForCheckoutItem };
@@ -1,12 +1,12 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
2
  import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
- import { viewBookedSizeChangeProductsVariantsForCheckoutItem } from "../../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
3
+ import { viewBookedProductsVariantsForCheckoutItem } from "../../../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
4
4
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
5
  const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
6
- const useViewBookedSizeChangeProductsVariantsForCheckoutItem = ({ checkoutItemId }) => useQuery({
7
- query: viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId }),
6
+ const useViewBookedProductsVariantsForCheckoutItem = ({ checkoutItemId, }) => useQuery({
7
+ query: viewBookedProductsVariantsForCheckoutItem({ checkoutItemId }),
8
8
  contextId: MESSAGING_CONTEXT_ID,
9
9
  invalidation: isCheckoutBookingBooked,
10
10
  options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
11
11
  });
12
- export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
12
+ export { useViewBookedProductsVariantsForCheckoutItem };
@@ -2,14 +2,13 @@ import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Butt
2
2
  import { BUTTON_VARIANT } from "@lookiero/aurora-next/build/components/atoms/Button/Button.definition";
3
3
  import { useI18nMessage } from "@lookiero/i18n-react";
4
4
  import React, { useCallback } from "react";
5
- import { CHECKOUT_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
6
5
  import { theme } from "../../../../../theme/theme";
7
6
  import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
8
7
  import { style } from "./ButtonCheckoutQuestionItem.style";
9
8
  const { colorAccent, colorBase } = theme();
10
9
  const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
11
10
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
12
- const optionText = useI18nMessage({ id: checkoutQuestion.name, prefix: CHECKOUT_QUESTIONS_PREFIX });
11
+ const optionText = useI18nMessage({ id: checkoutQuestion.name });
13
12
  const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
14
13
  return (React.createElement(Button
15
14
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -1,10 +1,9 @@
1
1
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React from "react";
4
- import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
5
4
  import { style } from "./HostDefaultCheckoutQuestionItem.style";
6
5
  const HostDefaultCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
7
- const titleText = useI18nMessage({ id: checkoutQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
6
+ const titleText = useI18nMessage({ id: checkoutQuestion.name });
8
7
  return (React.createElement(React.Fragment, null,
9
8
  React.createElement(Text, { level: 3, style: style.title }, titleText),
10
9
  children));
@@ -2,10 +2,9 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React from "react";
4
4
  import { View } from "react-native";
5
- import { CHECKOUT_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
6
5
  import { style } from "./HostSelectCheckoutQuestionItem.style";
7
6
  const HostSelectCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
8
- const titleText = useI18nMessage({ id: checkoutQuestion.name, prefix: CHECKOUT_QUESTIONS_PREFIX });
7
+ const titleText = useI18nMessage({ id: checkoutQuestion.name });
9
8
  return (React.createElement(React.Fragment, null,
10
9
  React.createElement(Text, { level: 3, style: style.title }, titleText),
11
10
  React.createElement(View, { style: style.content }, children)));
@@ -1,5 +1,5 @@
1
1
  import { CheckoutQuestionItem } from "../CheckoutQuestionItem";
2
- type IconName = "checkout.checkout_question.icon.bad" | "checkout.checkout_question.icon.regular" | "checkout.checkout_question.icon.good";
2
+ type IconName = "checkout_question.icon.bad" | "checkout_question.icon.regular" | "checkout_question.icon.good";
3
3
  declare const IconCheckoutQuestionItem: CheckoutQuestionItem;
4
4
  export type { IconName };
5
5
  export { IconCheckoutQuestionItem };
@@ -10,11 +10,11 @@ import { Sad } from "./icons/Sad";
10
10
  const { colorAccent } = theme();
11
11
  const ICON = {
12
12
  // eslint-disable-next-line @typescript-eslint/naming-convention
13
- "checkout.checkout_question.icon.bad": Sad,
13
+ "checkout_question.icon.bad": Sad,
14
14
  // eslint-disable-next-line @typescript-eslint/naming-convention
15
- "checkout.checkout_question.icon.regular": Normal,
15
+ "checkout_question.icon.regular": Normal,
16
16
  // eslint-disable-next-line @typescript-eslint/naming-convention
17
- "checkout.checkout_question.icon.good": Happy,
17
+ "checkout_question.icon.good": Happy,
18
18
  };
19
19
  const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
20
20
  const Icon = ICON[checkoutQuestion.name];
@@ -1,14 +1,10 @@
1
1
  import { useI18nMessage } from "@lookiero/i18n-react";
2
2
  import React, { useCallback } from "react";
3
3
  import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
4
- import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
5
4
  import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
6
5
  const TEXTAREA_MIN_HEIGHT = 96;
7
6
  const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
8
- const placeholderText = useI18nMessage({
9
- id: checkoutQuestion.placeholder,
10
- prefix: RETURN_QUESTIONS_PREFIX,
11
- });
7
+ const placeholderText = useI18nMessage({ id: checkoutQuestion.placeholder });
12
8
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
13
9
  const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
14
10
  return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
@@ -1,10 +1,9 @@
1
1
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React from "react";
4
- import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
5
4
  import { style } from "./HostDefaultReturnQuestionItem.style";
6
5
  const HostDefaultReturnQuestionItem = ({ returnQuestion, children }) => {
7
- const titleText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
6
+ const titleText = useI18nMessage({ id: returnQuestion.name });
8
7
  return (React.createElement(React.Fragment, null,
9
8
  React.createElement(Text, { level: 3, style: style.title }, titleText),
10
9
  children));
@@ -4,19 +4,18 @@ import { TouchableHighlight, View } from "react-native";
4
4
  import { Modal } from "../../../../../../../shared/ui/components/layouts/modal/Modal";
5
5
  import { ButtonIcon } from "../../../../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
6
6
  import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
7
- import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
8
7
  import { useReturnQuestionFeedback, useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
9
8
  import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
10
9
  import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
11
10
  const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
12
- const placeholderText = useI18nMessage({ id: returnQuestion.placeholder, prefix: RETURN_QUESTIONS_PREFIX });
11
+ const placeholderText = useI18nMessage({ id: returnQuestion.placeholder });
13
12
  const [modalVisible, setModalVisible] = useState(false);
14
13
  const handleOnPress = useCallback(() => setModalVisible(true), []);
15
14
  const handleOnModalClose = useCallback(() => setModalVisible(false), []);
16
15
  const feedback = useReturnQuestionFeedback();
17
16
  const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestion.id });
18
17
  const intl = useIntl();
19
- const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: `${RETURN_QUESTIONS_PREFIX}${returnQuestionName}`, defaultMessage: returnQuestionName }), [intl]);
18
+ const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
20
19
  const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
21
20
  const deepestReturnQuestionWithFeedback = deepestReturnQuestionWithFeedbackForReturnQuestion({
22
21
  feedback,
@@ -3,17 +3,16 @@ import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import { animated, useSpring } from "@react-spring/native";
4
4
  import React, { useCallback, useState } from "react";
5
5
  import { View } from "react-native";
6
- import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
7
6
  import ReturnQuestion from "../../ReturnQuestion";
8
7
  import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
9
8
  import { style } from "./HostStackReturnQuestionItem.style";
10
9
  const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
11
- const titleText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
10
+ const titleText = useI18nMessage({ id: returnQuestion.name });
12
11
  const { feedback } = useReturnQuestionFeedbackForId({ id: returnQuestion.id });
13
12
  const feedbackReturnQuestion = feedback
14
13
  ? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
15
14
  : undefined;
16
- const feedbackText = useI18nMessage({ id: feedbackReturnQuestion?.name, prefix: RETURN_QUESTIONS_PREFIX });
15
+ const feedbackText = useI18nMessage({ id: feedbackReturnQuestion?.name });
17
16
  const [stackHeight, setStackHeight] = useState();
18
17
  const handleOnLayout = useCallback(({ nativeEvent: { layout: { height }, }, }) => setStackHeight(height), []);
19
18
  const stackSyle = useSpring({ height: stackHeight });
@@ -2,12 +2,11 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React, { useCallback } from "react";
4
4
  import { TouchableHighlight } from "react-native";
5
- import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
6
5
  import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
7
6
  import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
8
7
  const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
9
8
  const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
10
- const optionText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
9
+ const optionText = useI18nMessage({ id: returnQuestion.name });
11
10
  const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParentId]);
12
11
  return (React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
13
12
  React.createElement(Text, { level: 3, style: style.text }, optionText)));
@@ -2,22 +2,16 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
2
2
  import { useI18nMessage, useIntl } from "@lookiero/i18n-react";
3
3
  import React, { useCallback } from "react";
4
4
  import { View } from "react-native";
5
- import { I18nMessages, RETURN_QUESTIONS_FEEDBACK_PREFIX, RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
5
+ import { I18nMessages } from "../../../../../i18n/i18n";
6
6
  import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
7
7
  import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
8
8
  import { style } from "./ReturnQuestionFeedbackItem.style";
9
9
  const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
10
- const titleText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_FEEDBACK_PREFIX });
11
- const unansweredText = useI18nMessage({
12
- id: I18nMessages.FEEDBACK_UNANSWERED,
13
- prefix: RETURN_QUESTIONS_FEEDBACK_PREFIX,
14
- });
10
+ const titleText = useI18nMessage({ id: returnQuestion.name });
11
+ const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
15
12
  const returnQuestionFeedback = useReturnQuestionFeedback();
16
13
  const intl = useIntl();
17
- const translate = useCallback((returnQuestionName) => intl.formatMessage({
18
- id: `${RETURN_QUESTIONS_PREFIX}${returnQuestionName}`,
19
- defaultMessage: returnQuestionName,
20
- }), [intl]);
14
+ const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
21
15
  const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(" / ");
22
16
  return (React.createElement(View, { style: style.container },
23
17
  React.createElement(Text, { level: 2, style: style.title, detail: true }, titleText),
@@ -1,11 +1,10 @@
1
1
  import { useI18nMessage } from "@lookiero/i18n-react";
2
2
  import React, { useCallback } from "react";
3
3
  import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
4
- import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
5
4
  import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
6
5
  const TEXTAREA_MIN_HEIGHT = 96;
7
6
  const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
8
- const placeholderText = useI18nMessage({ id: returnQuestion.placeholder, prefix: RETURN_QUESTIONS_PREFIX });
7
+ const placeholderText = useI18nMessage({ id: returnQuestion.placeholder });
9
8
  const { feedback, onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
10
9
  const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: value }), [onChange, returnQuestionParentId]);
11
10
  return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
@@ -4,6 +4,7 @@ import { Edge } from "react-native-safe-area-context";
4
4
  type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
5
5
  interface SafeAreaScrollViewProps {
6
6
  readonly children: ReactNode;
7
+ readonly scrollerPaddingTop?: number;
7
8
  readonly edges?: Edge[];
8
9
  readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
9
10
  }
@@ -1,16 +1,14 @@
1
1
  import React from "react";
2
2
  import { ScrollView } from "react-native";
3
3
  import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
- import { theme } from "../../theme/theme";
5
- const { spaceXL } = theme();
6
- const SafeAreaScrollView = ({ children, edges = ["top", "bottom", "left", "right"], style: customStyle, }) => {
4
+ const SafeAreaScrollView = ({ children, edges = ["top", "bottom", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
7
5
  const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
8
6
  return (React.createElement(SafeAreaView, { edges: edges, style: customStyle?.safeAreaView },
9
7
  React.createElement(ScrollView, { contentContainerStyle: [
10
8
  {
11
9
  // Why did we set this??
12
- paddingTop: !safeAreaInsetTop ? spaceXL : 0,
13
- paddingBottom: !safeAreaInsetBottom ? spaceXL : 0,
10
+ paddingTop: safeAreaInsetTop + scrollerPaddingTop,
11
+ paddingBottom: safeAreaInsetBottom,
14
12
  },
15
13
  customStyle?.scrollView,
16
14
  ] }, children)));
@@ -1,7 +1,4 @@
1
1
  declare const COLOR_I18N_PREFIX = "color.";
2
- declare const RETURN_QUESTIONS_PREFIX = "return_questions.";
3
- declare const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
4
- declare const CHECKOUT_QUESTIONS_PREFIX = "checkout_questions.";
5
2
  declare enum I18nMessages {
6
3
  INTRO_TITLE = "intro.title",
7
4
  INTRO_SUBTITLE = "intro.subtitle",
@@ -30,8 +27,8 @@ declare enum I18nMessages {
30
27
  GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION = "get_out_of_checkout_modal.description",
31
28
  GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON = "get_out_of_checkout_modal.dismiss_button",
32
29
  GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON = "get_out_of_checkout_modal.confirm_button",
33
- FEEDBACK_TITLE = "feedback.title",
34
- FEEDBACK_UNANSWERED = "feedback.unanswered",
30
+ FEEDBACK_TITLE = "return_questions_feedback.feedback.title",
31
+ FEEDBACK_UNANSWERED = "return_questions_feedback.feedback.unanswered",
35
32
  RETURN_QUESTIONS_TITLE = "return_questions.title",
36
33
  RETURN_QUESTIONS_SUBMIT_BUTTON = "return_questions.submit_button",
37
34
  SUMMARY_TITLE = "summary.title",
@@ -62,4 +59,4 @@ declare enum I18nMessages {
62
59
  HEADER_COMPLETE_CHECKOUT_TITLE = "header.complete_checkout_title",
63
60
  FEEDBACK_BUTTON = "feedback.button"
64
61
  }
65
- export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX, CHECKOUT_QUESTIONS_PREFIX, };
62
+ export { I18nMessages, COLOR_I18N_PREFIX };
@@ -1,7 +1,4 @@
1
1
  const COLOR_I18N_PREFIX = "color.";
2
- const RETURN_QUESTIONS_PREFIX = "return_questions.";
3
- const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
4
- const CHECKOUT_QUESTIONS_PREFIX = "checkout_questions.";
5
2
  var I18nMessages;
6
3
  (function (I18nMessages) {
7
4
  I18nMessages["INTRO_TITLE"] = "intro.title";
@@ -31,8 +28,8 @@ var I18nMessages;
31
28
  I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION"] = "get_out_of_checkout_modal.description";
32
29
  I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON"] = "get_out_of_checkout_modal.dismiss_button";
33
30
  I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON"] = "get_out_of_checkout_modal.confirm_button";
34
- I18nMessages["FEEDBACK_TITLE"] = "feedback.title";
35
- I18nMessages["FEEDBACK_UNANSWERED"] = "feedback.unanswered";
31
+ I18nMessages["FEEDBACK_TITLE"] = "return_questions_feedback.feedback.title";
32
+ I18nMessages["FEEDBACK_UNANSWERED"] = "return_questions_feedback.feedback.unanswered";
36
33
  I18nMessages["RETURN_QUESTIONS_TITLE"] = "return_questions.title";
37
34
  I18nMessages["RETURN_QUESTIONS_SUBMIT_BUTTON"] = "return_questions.submit_button";
38
35
  I18nMessages["SUMMARY_TITLE"] = "summary.title";
@@ -63,4 +60,4 @@ var I18nMessages;
63
60
  I18nMessages["HEADER_COMPLETE_CHECKOUT_TITLE"] = "header.complete_checkout_title";
64
61
  I18nMessages["FEEDBACK_BUTTON"] = "feedback.button";
65
62
  })(I18nMessages || (I18nMessages = {}));
66
- export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX, CHECKOUT_QUESTIONS_PREFIX, };
63
+ export { I18nMessages, COLOR_I18N_PREFIX };
@@ -1,6 +1,5 @@
1
1
  import { PortalProvider } from "@gorhom/portal";
2
2
  import React from "react";
3
- import { View } from "react-native";
4
3
  import { SafeAreaProvider } from "react-native-safe-area-context";
5
4
  import { Notifications } from "../../../shared/notifications/infrastructure/ui/views/Notifications";
6
5
  import { style } from "./App.style";
@@ -8,6 +7,5 @@ import { Header } from "./header/Header";
8
7
  const App = ({ customerId, menu, children }) => (React.createElement(SafeAreaProvider, null,
9
8
  React.createElement(Header, { customerId: customerId, menu: menu, style: style.header }),
10
9
  React.createElement(Notifications, null),
11
- React.createElement(PortalProvider, null,
12
- React.createElement(View, { style: style.body }, children))));
10
+ React.createElement(PortalProvider, null, children)));
13
11
  export { App };
@@ -1,9 +1,4 @@
1
1
  declare const style: {
2
- body: {
3
- minHeight: string;
4
- paddingTop: number;
5
- zIndex: number;
6
- };
7
2
  header: {};
8
3
  };
9
4
  export { style };
@@ -1,12 +1,5 @@
1
1
  import { Platform, StyleSheet } from "react-native";
2
- import { theme } from "../theme/theme";
3
- const { spaceXXXL } = theme();
4
2
  const style = StyleSheet.create({
5
- body: {
6
- minHeight: "100%",
7
- paddingTop: spaceXXXL,
8
- zIndex: 0,
9
- },
10
3
  header: {
11
4
  ...Platform.select({
12
5
  web: {
@@ -19,6 +19,7 @@ import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollVie
19
19
  import { I18nMessages } from "../../i18n/i18n";
20
20
  import { Routes } from "../../routing/routes";
21
21
  import { useBasePath } from "../../routing/useBasePath";
22
+ import { HEADER_HEIGHT } from "../header/Header.style";
22
23
  import { ProductVariant } from "../item/components/productVariant/ProductVariant";
23
24
  import { Pricing } from "../summary/components/pricing/Pricing";
24
25
  import { style } from "./Checkout.style";
@@ -86,7 +87,7 @@ const Checkout = ({ customerId, getAuthToken, useRedirect }) => {
86
87
  return React.createElement(Spinner, null);
87
88
  return (React.createElement(React.Fragment, null,
88
89
  React.createElement(CheckoutSuccessModal, { visible: success, onDismiss: handleOnSuccessModalDismiss }),
89
- React.createElement(SafeAreaScrollView, null,
90
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
90
91
  React.createElement(Body, { style: { column: style.bodyColumn } },
91
92
  hasReplacedCheckoutItem && (React.createElement(View, { style: style.deliveryBannerContainer },
92
93
  React.createElement(DeliveryBanner, null))),
@@ -10,6 +10,7 @@ declare const style: {
10
10
  };
11
11
  pricingContainer: {
12
12
  marginTop: number;
13
+ paddingBottom: number;
13
14
  };
14
15
  title: {
15
16
  marginBottom: number;
@@ -13,6 +13,7 @@ const style = StyleSheet.create({
13
13
  },
14
14
  pricingContainer: {
15
15
  marginTop: spaceXL,
16
+ paddingBottom: spaceXL,
16
17
  },
17
18
  title: {
18
19
  marginBottom: spaceM,
@@ -7,6 +7,7 @@ import { useListCheckoutQuestionsByCheckoutId } from "../../../projection/checko
7
7
  import { Body } from "../../components/layouts/body/Body";
8
8
  import { CheckoutQuestionFeedbackProvider } from "../../components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionFeedback";
9
9
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
10
+ import { HEADER_HEIGHT } from "../header/Header.style";
10
11
  import { style } from "./Feedback.style";
11
12
  import { CheckoutQuestionsForm } from "./components/checkoutQuestionsForm/CheckoutQuestionsForm";
12
13
  const Feedback = ({ customerId }) => {
@@ -28,7 +29,7 @@ const Feedback = ({ customerId }) => {
28
29
  if (!dependenciesLoaded)
29
30
  return React.createElement(Spinner, null);
30
31
  return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {} },
31
- React.createElement(SafeAreaScrollView, null,
32
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
32
33
  React.createElement(Body, { style: { column: style.bodyColumn } },
33
34
  React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
34
35
  };
@@ -1,3 +1,4 @@
1
+ declare const HEADER_HEIGHT: number;
1
2
  declare const style: {
2
3
  buttonIconPlaceholder: {
3
4
  height: number;
@@ -25,4 +26,4 @@ declare const style: {
25
26
  textTransform: "uppercase";
26
27
  };
27
28
  };
28
- export { style };
29
+ export { style, HEADER_HEIGHT };
@@ -1,6 +1,7 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../theme/theme";
3
3
  const { colorBase, spaceXXL, spaceXXXL, spaceS } = theme();
4
+ const HEADER_HEIGHT = spaceXXXL;
4
5
  const style = StyleSheet.create({
5
6
  buttonIconPlaceholder: {
6
7
  height: spaceXXL,
@@ -9,7 +10,7 @@ const style = StyleSheet.create({
9
10
  container: {
10
11
  backgroundColor: colorBase,
11
12
  flex: 1,
12
- height: spaceXXXL,
13
+ height: HEADER_HEIGHT,
13
14
  paddingHorizontal: spaceS,
14
15
  width: "100%",
15
16
  },
@@ -28,4 +29,4 @@ const style = StyleSheet.create({
28
29
  textTransform: "uppercase",
29
30
  },
30
31
  });
31
- export { style };
32
+ export { style, HEADER_HEIGHT };
@@ -11,6 +11,7 @@ import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checko
11
11
  import { Body } from "../../components/layouts/body/Body";
12
12
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
13
13
  import { I18nMessages } from "../../i18n/i18n";
14
+ import { HEADER_HEIGHT } from "../header/Header.style";
14
15
  import { style } from "./Intro.style";
15
16
  const Bullet = ({ text }) => (React.createElement(View, { style: style.bullet },
16
17
  React.createElement(Icon, { name: "rounded-tick", style: style.tickIcon }),
@@ -29,7 +30,7 @@ const Intro = ({ customerId }) => {
29
30
  const [incrementIntroShownCount, incrementIntroShownCountStatus] = useIncrementIntroShownCount();
30
31
  if (fiveItemsDiscountStatus === QueryStatus.LOADING)
31
32
  return React.createElement(Spinner, null);
32
- return (React.createElement(SafeAreaScrollView, null,
33
+ return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
33
34
  React.createElement(Body, { style: { column: style.bodyColumn } },
34
35
  React.createElement(View, { style: style.container },
35
36
  React.createElement(View, { style: style.content },
@@ -1,6 +1,6 @@
1
1
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from "react";
3
- import { View } from "react-native";
3
+ import { Platform, View } from "react-native";
4
4
  import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
5
5
  import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
6
6
  import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
@@ -9,7 +9,7 @@ import { useBookCheckoutBookingForCheckoutItem } from "../../../domain/checkoutB
9
9
  import { useKeepCheckoutItem } from "../../../domain/checkoutItem/react/useKeepCheckoutItem";
10
10
  import { useReplaceCheckoutItem } from "../../../domain/checkoutItem/react/useReplaceCheckoutItem";
11
11
  import { useReturnCheckoutItem } from "../../../domain/checkoutItem/react/useReturnCheckoutItem";
12
- import { useViewBookedSizeChangeProductsVariantsForCheckoutItem } from "../../../projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem";
12
+ import { useViewBookedProductsVariantsForCheckoutItem } from "../../../projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem";
13
13
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
14
14
  import { useListReturnQuestionsByCheckoutItemId } from "../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
15
15
  import { Body } from "../../components/layouts/body/Body";
@@ -17,6 +17,8 @@ import { ReturnQuestionFeedbackProvider } from "../../components/organisms/retur
17
17
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
18
18
  import { Routes } from "../../routing/routes";
19
19
  import { useBasePath } from "../../routing/useBasePath";
20
+ import { theme } from "../../theme/theme";
21
+ import { HEADER_HEIGHT } from "../header/Header.style";
20
22
  import { style } from "./Item.style";
21
23
  import { CustomerDecissionBanner } from "./components/banner/CustomerDecissionBanner";
22
24
  import { ItemActions } from "./components/itemActions/ItemActions";
@@ -26,6 +28,7 @@ import { ReturnQuestionsFeedback } from "./components/returnQuestionsFeedback/Re
26
28
  import { ReturnQuestionsForm } from "./components/returnQuestionsForm/ReturnQuestionsForm";
27
29
  import { SizeChangeModal } from "./components/sizeChangeModal/SizeChangeModal";
28
30
  import { SizeWithoutStockModal } from "./components/sizeWithoutStockModal/SizeWithoutStockModal";
31
+ const { spaceXL } = theme();
29
32
  const Item = ({ customerId }) => {
30
33
  const { id } = useParams();
31
34
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
@@ -70,7 +73,7 @@ const Item = ({ customerId }) => {
70
73
  navigateToNextView();
71
74
  }
72
75
  }, [navigateToNextView, replaceCheckoutItemStatus]);
73
- const [bookedSizeChangeProductsVariants, bookedSizeChangeProductsVariantsStatus] = useViewBookedSizeChangeProductsVariantsForCheckoutItem({
76
+ const [bookedProductsVariants, bookedProductsVariantsStatus] = useViewBookedProductsVariantsForCheckoutItem({
74
77
  checkoutItemId: checkoutItem.id,
75
78
  });
76
79
  const [bookCheckoutBooking] = useBookCheckoutBookingForCheckoutItem({
@@ -78,8 +81,8 @@ const Item = ({ customerId }) => {
78
81
  checkoutBookingId: checkout?.checkoutBookingId,
79
82
  });
80
83
  useEffect(() => {
81
- checkout && bookedSizeChangeProductsVariants === null && bookCheckoutBooking();
82
- }, [bookCheckoutBooking, bookedSizeChangeProductsVariants, checkout]);
84
+ checkout && bookedProductsVariants === null && bookCheckoutBooking();
85
+ }, [bookCheckoutBooking, bookedProductsVariants, checkout]);
83
86
  const [returnQuestions, returnQuestionsStatus] = useListReturnQuestionsByCheckoutItemId({
84
87
  checkoutItemId: checkoutItem.id,
85
88
  });
@@ -124,8 +127,8 @@ const Item = ({ customerId }) => {
124
127
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
125
128
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(returnQuestionsStatus) &&
126
129
  (dependenciesLoadedStatuses.includes(checkoutStatus) || checkout) &&
127
- dependenciesLoadedStatuses.includes(bookedSizeChangeProductsVariantsStatus) &&
128
- bookedSizeChangeProductsVariants;
130
+ dependenciesLoadedStatuses.includes(bookedProductsVariantsStatus) &&
131
+ bookedProductsVariants;
129
132
  if (!dependenciesLoaded)
130
133
  return React.createElement(Spinner, null);
131
134
  const { price } = checkoutItem;
@@ -133,16 +136,16 @@ const Item = ({ customerId }) => {
133
136
  return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: checkoutItem.feedbacks || {} },
134
137
  React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
135
138
  React.createElement(SizeChangeModal, { visible: sizeChangeModalVisible, onDismiss: handleOnHideSizeChangeModal }),
136
- React.createElement(SafeAreaScrollView, null,
139
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
137
140
  React.createElement(Body, null,
138
141
  customerDecissionMade && (React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: handleOnBannerPress })),
139
- React.createElement(View, { style: [style.container, { paddingBottom: stickyHeight }] },
142
+ React.createElement(View, { style: [style.container, { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight }] },
140
143
  React.createElement(View, { style: style.sliderContainer },
141
144
  React.createElement(ProductVariantSlider, { producVariantMedia: media })),
142
145
  React.createElement(ProductVariantDescription, { brand: brand, color: color, name: name, price: price, size: productVariantSelected.size }),
143
146
  checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: style.feedbackContainer },
144
147
  React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions || [], onEditFeedback: handleOnEditFeedback })))))),
145
- !customerDecissionMade && (React.createElement(ItemActions, { keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedSizeChangeProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })),
148
+ !customerDecissionMade && (React.createElement(ItemActions, { keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })),
146
149
  React.createElement(ReturnQuestionsForm, { checkoutItemPrice: checkoutItem.price, productVariant: checkoutItem.productVariant, returnQuestions: returnQuestions || [], visible: returnQuestionsVisible, onClose: handleOnHideReturnQuestions, onSubmit: handleOnSubmit })));
147
150
  };
148
151
  export { Item };
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import { ProductVariantProjection } from "../../../../../../projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants";
2
+ import { ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
3
3
  import { Layout } from "../../../../../../shared/ui/components/layouts/sticky/Sticky";
4
4
  interface ItemActionsProps {
5
5
  readonly productVariants: ProductVariantProjection[];
@@ -8,7 +8,7 @@ import { ReturnQuestions } from "../../../../components/organisms/returnQuestion
8
8
  import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
9
9
  import { HostDefaultReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem";
10
10
  import { ReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem";
11
- import { I18nMessages, RETURN_QUESTIONS_FEEDBACK_PREFIX } from "../../../../i18n/i18n";
11
+ import { I18nMessages } from "../../../../i18n/i18n";
12
12
  import { style } from "./ReturnQuestionsFeedback.style";
13
13
  const returnQuestionItems = {
14
14
  [ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionFeedbackItem,
@@ -19,7 +19,7 @@ const returnQuestionItems = {
19
19
  [ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
20
20
  };
21
21
  const ReturnQuestionsFeedback = ({ returnQuestions, onEditFeedback }) => {
22
- const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE, prefix: RETURN_QUESTIONS_FEEDBACK_PREFIX });
22
+ const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE });
23
23
  return (React.createElement(View, null,
24
24
  React.createElement(View, { style: style.titleContainer },
25
25
  React.createElement(Text, { level: 2, style: style.title }, titleText),
@@ -14,7 +14,7 @@ import { HostSelectReturnQuestionItem } from "../../../../components/organisms/r
14
14
  import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem";
15
15
  import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
16
16
  import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
17
- import { I18nMessages, RETURN_QUESTIONS_PREFIX } from "../../../../i18n/i18n";
17
+ import { I18nMessages } from "../../../../i18n/i18n";
18
18
  import { ProductVariant } from "../productVariant/ProductVariant";
19
19
  import { style } from "./ReturnQuestionsForm.style";
20
20
  const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
@@ -27,11 +27,8 @@ const returnQuestionItems = {
27
27
  [ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
28
28
  };
29
29
  const ReturnQuestionsForm = ({ returnQuestions, checkoutItemPrice, productVariant, visible, onSubmit, onClose, }) => {
30
- const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE, prefix: RETURN_QUESTIONS_PREFIX });
31
- const submitButtonText = useI18nMessage({
32
- id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON,
33
- prefix: RETURN_QUESTIONS_PREFIX,
34
- });
30
+ const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
31
+ const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
35
32
  const { media, brand, name, size, color } = productVariant;
36
33
  const feedback = useReturnQuestionFeedback();
37
34
  const handleOnSubmit = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
@@ -14,10 +14,13 @@ import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollVie
14
14
  import { I18nMessages } from "../../i18n/i18n";
15
15
  import { Routes } from "../../routing/routes";
16
16
  import { useBasePath } from "../../routing/useBasePath";
17
+ import { theme } from "../../theme/theme";
18
+ import { HEADER_HEIGHT } from "../header/Header.style";
17
19
  import { style } from "./Summary.style";
18
20
  import { CheckoutItemsTabs } from "./components/checkoutItemsTabs/CheckoutItemsTabs";
19
21
  import { FiveItemsDiscountBanner } from "./components/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
20
22
  import { StickyPricing } from "./components/stickyPricing/StickyPricing";
23
+ const { spaceXL } = theme();
21
24
  const Summary = ({ customerId }) => {
22
25
  const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
23
26
  const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
@@ -39,8 +42,8 @@ const Summary = ({ customerId }) => {
39
42
  if (!dependenciesLoaded)
40
43
  return React.createElement(Spinner, null);
41
44
  return (React.createElement(React.Fragment, null,
42
- React.createElement(SafeAreaScrollView, { style: { safeAreaView: style.container } },
43
- React.createElement(Body, null,
45
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT, style: { safeAreaView: style.container } },
46
+ React.createElement(Body, { style: { row: { paddingBottom: spaceXL } } },
44
47
  fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
45
48
  React.createElement(View, { style: style.content },
46
49
  React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
@@ -16,9 +16,9 @@ const CheckoutItemsTabs = ({ checkoutItemsKept, checkoutItemsReturned, onPressIt
16
16
  const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
17
17
  const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
18
18
  return (React.createElement(Tabs, { style: { sliderContainer: style.sliderContainer }, tabLabels: [`${keepTabText} (${checkoutItemsKept.length})`, `${returnTabText} (${checkoutItemsReturned.length})`] },
19
- React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text, null, keepEmptyText)) : (checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
19
+ React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text, { style: style.emptyText }, keepEmptyText)) : (checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
20
20
  ? checkoutItem.replacedFor
21
21
  : checkoutItem.productVariant, onPress: () => handleOnPressItem(checkoutItem.id) }))))),
22
- React.createElement(React.Fragment, null, checkoutItemsReturned.length === 0 ? (React.createElement(Text, null, returnEmptyText)) : (checkoutItemsReturned.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemProductVariant: checkoutItem.productVariant, checkoutItemStatus: checkoutItem.status, style: { image: style.returnCheckoutItem }, testID: "return-checkout-item", discarded: true, onPress: () => handleOnPressItem(checkoutItem.id) })))))));
22
+ React.createElement(React.Fragment, null, checkoutItemsReturned.length === 0 ? (React.createElement(Text, { style: style.emptyText }, returnEmptyText)) : (checkoutItemsReturned.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemProductVariant: checkoutItem.productVariant, checkoutItemStatus: checkoutItem.status, style: { image: style.returnCheckoutItem }, testID: "return-checkout-item", discarded: true, onPress: () => handleOnPressItem(checkoutItem.id) })))))));
23
23
  };
24
24
  export { CheckoutItemsTabs };
@@ -2,6 +2,9 @@ declare const style: {
2
2
  checkoutItem: {
3
3
  paddingVertical: number;
4
4
  };
5
+ emptyText: {
6
+ paddingTop: number;
7
+ };
5
8
  returnCheckoutItem: {
6
9
  borderColor: string;
7
10
  };
@@ -5,6 +5,9 @@ const style = StyleSheet.create({
5
5
  checkoutItem: {
6
6
  paddingVertical: spaceM,
7
7
  },
8
+ emptyText: {
9
+ paddingTop: spaceM,
10
+ },
8
11
  returnCheckoutItem: {
9
12
  borderColor: colorContent,
10
13
  },
@@ -3,7 +3,7 @@ interface ProductVariantProjection {
3
3
  readonly id: string;
4
4
  readonly size: SizeProjection;
5
5
  }
6
- interface BookedSizeChangeProductsVariantsProjection {
6
+ interface BookedProductsVariantsProjection {
7
7
  readonly productVariants: ProductVariantProjection[];
8
8
  }
9
- export type { BookedSizeChangeProductsVariantsProjection, ProductVariantProjection };
9
+ export type { BookedProductsVariantsProjection, ProductVariantProjection };
@@ -0,0 +1,25 @@
1
+ import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
+ import { BookedProductsVariantsProjection } from "./bookedProductsVariants";
3
+ declare const VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM = "view_booked_product_variants_for_checkout_item";
4
+ interface ViewBookedProductsVariantsForCheckoutItemPayload {
5
+ readonly checkoutItemId: string;
6
+ }
7
+ interface ViewBookedProductsVariantsForCheckoutItem extends Query<typeof VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM>, ViewBookedProductsVariantsForCheckoutItemPayload {
8
+ }
9
+ interface ViewBookedProductsVariantsForCheckoutItemFunction {
10
+ (payload: ViewBookedProductsVariantsForCheckoutItemPayload): ViewBookedProductsVariantsForCheckoutItem;
11
+ }
12
+ declare const viewBookedProductsVariantsForCheckoutItem: ViewBookedProductsVariantsForCheckoutItemFunction;
13
+ type ViewBookedProductsVariantsForCheckoutItemResult = BookedProductsVariantsProjection | null;
14
+ interface BookedProductsVariantsForCheckoutItemViewArgs extends CancelableQueryViewArgs {
15
+ readonly checkoutItemId: string;
16
+ }
17
+ interface BookedProductsVariantsForCheckoutItemView {
18
+ (args: BookedProductsVariantsForCheckoutItemViewArgs): Promise<ViewBookedProductsVariantsForCheckoutItemResult>;
19
+ }
20
+ interface ViewBookedProductsVariantsForCheckoutItemHandlerFunctionArgs extends QueryHandlerFunctionArgs {
21
+ readonly view: BookedProductsVariantsForCheckoutItemView;
22
+ }
23
+ declare const viewBookedProductsVariantsForCheckoutItemHandler: QueryHandlerFunction<ViewBookedProductsVariantsForCheckoutItem, ViewBookedProductsVariantsForCheckoutItemResult, ViewBookedProductsVariantsForCheckoutItemHandlerFunctionArgs>;
24
+ export type { ViewBookedProductsVariantsForCheckoutItem, BookedProductsVariantsForCheckoutItemView, ViewBookedProductsVariantsForCheckoutItemResult, };
25
+ export { VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedProductsVariantsForCheckoutItem, viewBookedProductsVariantsForCheckoutItemHandler, };
@@ -0,0 +1,8 @@
1
+ import { query, } from "@lookiero/messaging";
2
+ const VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM = "view_booked_product_variants_for_checkout_item";
3
+ const viewBookedProductsVariantsForCheckoutItem = (payload) => ({
4
+ ...query({ name: VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM }),
5
+ ...payload,
6
+ });
7
+ const viewBookedProductsVariantsForCheckoutItemHandler = ({ view, signal }) => async ({ checkoutItemId }) => view({ checkoutItemId, signal });
8
+ export { VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedProductsVariantsForCheckoutItem, viewBookedProductsVariantsForCheckoutItemHandler, };
@@ -3,11 +3,16 @@ import { View } from "react-native";
3
3
  import { Column } from "../../../../ui/components/layouts/column/Column";
4
4
  import { Row } from "../../../../ui/components/layouts/row/Row";
5
5
  import { Stack } from "../../../../ui/components/layouts/stack/Stack";
6
+ import { useScreenSize } from "../../../../ui/hooks/useScreenSize";
6
7
  import { NotificationItem } from "./NotificationItem";
7
8
  import { style } from "./Notifications.style";
8
9
  const NOTIFICATIONS_AUTOHIDE_TIMEOUT = 10000;
9
- const Notifications = ({ notifications = [], onRemove, autoHideTimeout = NOTIFICATIONS_AUTOHIDE_TIMEOUT, }) => (React.createElement(View, { pointerEvents: "box-none", style: style.notifications, testID: "notifications" },
10
- React.createElement(Row, { style: style.row },
11
- React.createElement(Column, null,
12
- React.createElement(Stack, null, notifications.map((notification) => (React.createElement(NotificationItem, { key: notification.id, autoHideTimeout: autoHideTimeout, notification: notification, style: { toast: style.toast }, testID: notification.id, onRemove: onRemove }))))))));
10
+ const Notifications = ({ notifications = [], onRemove, autoHideTimeout = NOTIFICATIONS_AUTOHIDE_TIMEOUT, }) => {
11
+ const screenSize = useScreenSize();
12
+ const isSmallDevice = screenSize === "S";
13
+ return (React.createElement(View, { pointerEvents: "box-none", style: style.notifications, testID: "notifications" },
14
+ React.createElement(Row, { style: [style.row, isSmallDevice && style.rowSmall] },
15
+ React.createElement(Column, null,
16
+ React.createElement(Stack, null, notifications.map((notification) => (React.createElement(NotificationItem, { key: notification.id, autoHideTimeout: autoHideTimeout, notification: notification, style: { toast: style.toast }, testID: notification.id, onRemove: onRemove }))))))));
17
+ };
13
18
  export { Notifications };
@@ -1,25 +1,33 @@
1
- declare const style: {
2
- layoutLarge: {
3
- paddingLeft: number;
4
- paddingRight: number;
5
- };
6
- layoutSmall: {
7
- paddingLeft: string;
8
- paddingRight: string;
9
- };
1
+ import { StyleSheet } from "react-native";
2
+ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
10
3
  notifications: {
4
+ top: number;
5
+ width: string;
6
+ zIndex: number;
11
7
  left: number;
12
- position: "absolute";
8
+ } | {
13
9
  top: number;
14
10
  width: string;
15
11
  zIndex: number;
12
+ position: "sticky";
13
+ left: number;
14
+ } | {
15
+ top: number;
16
+ width: string;
17
+ zIndex: number;
18
+ position: "absolute";
19
+ left: number;
16
20
  };
17
21
  row: {
18
22
  flex: number;
19
23
  justifyContent: "center";
20
24
  };
25
+ rowSmall: {
26
+ paddingLeft: number;
27
+ paddingRight: number;
28
+ };
21
29
  toast: {
22
30
  marginTop: number;
23
31
  };
24
- };
32
+ }>;
25
33
  export { style };
@@ -1,18 +1,16 @@
1
- import { StyleSheet } from "react-native";
1
+ import { Platform, StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
3
  const { spaceM } = theme();
4
4
  const style = StyleSheet.create({
5
- layoutLarge: {
6
- paddingLeft: 0,
7
- paddingRight: 0,
8
- },
9
- layoutSmall: {
10
- paddingLeft: "$spaceM",
11
- paddingRight: "$spaceM",
12
- },
5
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
+ // @ts-ignore
13
7
  notifications: {
14
8
  left: 0,
15
- position: "absolute",
9
+ ...Platform.select({
10
+ web: { position: "sticky" },
11
+ ios: { position: "absolute" },
12
+ android: { position: "absolute" },
13
+ }),
16
14
  top: 0,
17
15
  width: "100%",
18
16
  zIndex: 20,
@@ -21,6 +19,10 @@ const style = StyleSheet.create({
21
19
  flex: 1,
22
20
  justifyContent: "center",
23
21
  },
22
+ rowSmall: {
23
+ paddingLeft: spaceM,
24
+ paddingRight: spaceM,
25
+ },
24
26
  toast: {
25
27
  marginTop: spaceM,
26
28
  },
@@ -10,17 +10,19 @@ import { ButtonIcon } from "../../molecules/buttonIcon/ButtonIcon";
10
10
  import { Row } from "../row/Row";
11
11
  import { Sticky } from "../sticky/Sticky";
12
12
  import { style } from "./Modal.style";
13
- const { spaceXXL } = theme();
13
+ const { spaceXL, spaceXXL } = theme();
14
14
  const TRANSITION_MODAL_SCALE = 0.9;
15
15
  const DEFAULT_SAFEAREA_INSET_TOP = spaceXXL;
16
+ const MODAL_DESKTOP_VERTICAL_PADDING = spaceXXL;
16
17
  const Modal = ({ children, visible, header, footer, portalHostName, onClose, showCloseButton = false, size = { M: "2/3", L: "1/3" }, style: customStyle, scroll = false, }) => {
17
18
  const { height: screenHeight } = Dimensions.get(Platform.OS === "web" ? "window" : "screen");
18
19
  const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
19
- // On Android safeAreaInsetTop won't return the actual value.
20
- const screenSizeWithoutInsets = screenHeight - (Platform.OS === "android" ? DEFAULT_SAFEAREA_INSET_TOP : safeAreaInsetTop);
21
20
  const screenSize = useScreenSize();
22
21
  const isSmallDevice = screenSize === "S";
23
22
  const columnSizeForScreenSize = size[screenSize];
23
+ // On Android safeAreaInsetTop won't return the actual value.
24
+ const screenSizeWithoutInsets = screenHeight - (Platform.OS === "android" ? DEFAULT_SAFEAREA_INSET_TOP : safeAreaInsetTop);
25
+ const modalMaxHeight = screenSizeWithoutInsets - (!isSmallDevice ? MODAL_DESKTOP_VERTICAL_PADDING : 0);
24
26
  const handleHardwareBackPress = useCallback(() => {
25
27
  if (!visible) {
26
28
  return;
@@ -65,7 +67,7 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
65
67
  {
66
68
  opacity: modalOpacity,
67
69
  transform: [{ translateY: modalTranslateY }, { scale: modalScale }],
68
- maxHeight: screenSizeWithoutInsets,
70
+ maxHeight: modalMaxHeight,
69
71
  },
70
72
  customStyle?.modal,
71
73
  ], onLayout: handleOnModalLayout },
@@ -73,7 +75,9 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
73
75
  React.createElement(View, null, header),
74
76
  showCloseButton && (React.createElement(ButtonIcon, { name: "close", style: { button: customStyle?.closeButton }, onPress: onClose })))),
75
77
  React.createElement(ModalContentView, null,
76
- React.createElement(View, { style: { paddingBottom: safeAreaInsetBottom + footerHeight } }, children)),
78
+ React.createElement(View, { style: {
79
+ paddingBottom: safeAreaInsetBottom + (Platform.OS === "web" ? spaceXL : footerHeight),
80
+ } }, children)),
77
81
  footer && (React.createElement(Sticky, { style: style.stickyFooter, onLayout: handleOnFooterLayout }, footer))))))))));
78
82
  };
79
83
  export { Modal };
@@ -29,15 +29,18 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
29
29
  "2/3": ViewStyle;
30
30
  container: {
31
31
  width: string;
32
+ zIndex: number;
32
33
  height: string;
33
34
  overflow: "hidden";
34
35
  } | {
35
36
  width: string;
37
+ zIndex: number;
36
38
  position: "fixed";
37
39
  height: string;
38
40
  overflow: "hidden";
39
41
  } | {
40
42
  width: string;
43
+ zIndex: number;
41
44
  position: "absolute";
42
45
  height: string;
43
46
  overflow: "hidden";
@@ -27,6 +27,7 @@ const style = StyleSheet.create({
27
27
  ios: { position: "absolute" },
28
28
  }),
29
29
  width: "100%",
30
+ zIndex: 100,
30
31
  },
31
32
  header: {
32
33
  alignItems: "center",
@@ -11,7 +11,7 @@ const style = StyleSheet.create({
11
11
  paddingTop: spaceXL,
12
12
  shadowColor: colorBase,
13
13
  shadowOffset: {
14
- height: -40,
14
+ height: -spaceXL,
15
15
  width: 0,
16
16
  },
17
17
  shadowOpacity: 1,
@@ -1,6 +1,7 @@
1
1
  declare const buttonIconUnderlayColor: string;
2
2
  declare const style: {
3
3
  buttonIcon: {
4
+ flexGrow: number;
4
5
  padding: number;
5
6
  };
6
7
  };
@@ -4,6 +4,7 @@ const { spaceS, colorGrayscaleS } = theme();
4
4
  const buttonIconUnderlayColor = colorGrayscaleS;
5
5
  const style = StyleSheet.create({
6
6
  buttonIcon: {
7
+ flexGrow: 0,
7
8
  padding: spaceS,
8
9
  },
9
10
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -35,7 +35,7 @@
35
35
  "@react-spring/native": "^9.5.5",
36
36
  "inline-style-prefixer": "6.0.1",
37
37
  "react-native-safe-area-context": "^4.4.1",
38
- "react-native-svg": "12.3.0",
38
+ "react-native-svg": "^12.1.1",
39
39
  "tiny-invariant": "^1.3.1",
40
40
  "uuid": "^9.0.0"
41
41
  },
@@ -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,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,25 +0,0 @@
1
- import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
- import { BookedSizeChangeProductsVariantsProjection } from "./bookedSizeChangeProductsVariants";
3
- declare const VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM = "view_booked_size_change_product_variants_for_checkout_item";
4
- interface ViewBookedSizeChangeProductsVariantsForCheckoutItemPayload {
5
- readonly checkoutItemId: string;
6
- }
7
- interface ViewBookedSizeChangeProductsVariantsForCheckoutItem extends Query<typeof VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM>, ViewBookedSizeChangeProductsVariantsForCheckoutItemPayload {
8
- }
9
- interface ViewBookedSizeChangeProductsVariantsForCheckoutItemFunction {
10
- (payload: ViewBookedSizeChangeProductsVariantsForCheckoutItemPayload): ViewBookedSizeChangeProductsVariantsForCheckoutItem;
11
- }
12
- declare const viewBookedSizeChangeProductsVariantsForCheckoutItem: ViewBookedSizeChangeProductsVariantsForCheckoutItemFunction;
13
- type ViewBookedSizeChangeProductsVariantsForCheckoutItemResult = BookedSizeChangeProductsVariantsProjection | null;
14
- interface BookedSizeChangeProductsVariantsForCheckoutItemViewArgs extends CancelableQueryViewArgs {
15
- readonly checkoutItemId: string;
16
- }
17
- interface BookedSizeChangeProductsVariantsForCheckoutItemView {
18
- (args: BookedSizeChangeProductsVariantsForCheckoutItemViewArgs): Promise<ViewBookedSizeChangeProductsVariantsForCheckoutItemResult>;
19
- }
20
- interface ViewBookedSizeChangeProductsVariantsForCheckoutItemHandlerFunctionArgs extends QueryHandlerFunctionArgs {
21
- readonly view: BookedSizeChangeProductsVariantsForCheckoutItemView;
22
- }
23
- declare const viewBookedSizeChangeProductsVariantsForCheckoutItemHandler: QueryHandlerFunction<ViewBookedSizeChangeProductsVariantsForCheckoutItem, ViewBookedSizeChangeProductsVariantsForCheckoutItemResult, ViewBookedSizeChangeProductsVariantsForCheckoutItemHandlerFunctionArgs>;
24
- export type { ViewBookedSizeChangeProductsVariantsForCheckoutItem, BookedSizeChangeProductsVariantsForCheckoutItemView, ViewBookedSizeChangeProductsVariantsForCheckoutItemResult, };
25
- export { VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeChangeProductsVariantsForCheckoutItem, viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, };
@@ -1,8 +0,0 @@
1
- import { query, } from "@lookiero/messaging";
2
- const VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM = "view_booked_size_change_product_variants_for_checkout_item";
3
- const viewBookedSizeChangeProductsVariantsForCheckoutItem = (payload) => ({
4
- ...query({ name: VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM }),
5
- ...payload,
6
- });
7
- const viewBookedSizeChangeProductsVariantsForCheckoutItemHandler = ({ view, signal }) => async ({ checkoutItemId }) => view({ checkoutItemId, signal });
8
- export { VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeChangeProductsVariantsForCheckoutItem, viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, };