@lookiero/checkout 8.13.5-beta.0 → 8.14.0-beta.0

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 (93) hide show
  1. package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
  2. package/dist/src/infrastructure/ui/Root.d.ts +2 -0
  3. package/dist/src/infrastructure/ui/Root.js +2 -2
  4. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +5 -0
  5. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
  6. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +5 -0
  7. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
  8. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +5 -0
  9. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
  10. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
  11. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
  12. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -1
  13. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -2
  14. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +3 -1
  15. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -3
  16. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -4
  17. package/dist/src/infrastructure/ui/routing/Routing.d.ts +7 -0
  18. package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
  19. package/dist/src/infrastructure/ui/views/App.d.ts +8 -0
  20. package/dist/src/infrastructure/ui/views/App.js +8 -6
  21. package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
  22. package/dist/src/infrastructure/ui/views/App.style.js +7 -0
  23. package/dist/src/infrastructure/ui/views/item/Item.d.ts +5 -0
  24. package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
  25. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +2 -0
  26. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
  27. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
  28. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
  29. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +5 -1
  30. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
  31. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +5 -0
  32. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  33. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -3
  34. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
  35. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
  36. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
  37. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +2 -0
  38. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
  39. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +5 -0
  40. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
  41. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +5 -0
  42. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
  43. package/dist/src/infrastructure/ui/views/return/Return.d.ts +5 -0
  44. package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
  45. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +5 -0
  46. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +12 -14
  47. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +2 -6
  48. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -6
  49. package/dist/src/version.d.ts +1 -1
  50. package/dist/src/version.js +1 -1
  51. package/jest.setup.js +20 -0
  52. package/package.json +4 -3
  53. package/pact.config.ts +31 -0
  54. package/pact.publish.js +32 -0
  55. package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +62 -0
  56. package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +128 -0
  57. package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +63 -0
  58. package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +57 -0
  59. package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +57 -0
  60. package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +57 -0
  61. package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +63 -0
  62. package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +64 -0
  63. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +62 -0
  64. package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +136 -0
  65. package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
  66. package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +62 -0
  67. package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +62 -0
  68. package/src/infrastructure/ui/Root.tsx +4 -1
  69. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +14 -1
  70. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +8 -1
  71. package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +6 -0
  72. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
  73. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +2 -1
  74. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +2 -0
  75. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -0
  76. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +5 -2
  77. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +3 -2
  78. package/src/infrastructure/ui/routing/Routing.tsx +13 -5
  79. package/src/infrastructure/ui/views/App.style.ts +9 -0
  80. package/src/infrastructure/ui/views/App.tsx +21 -11
  81. package/src/infrastructure/ui/views/item/Item.tsx +8 -2
  82. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
  83. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +9 -3
  84. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +8 -1
  85. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +12 -3
  86. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
  87. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -6
  88. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -3
  89. package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +12 -2
  90. package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +14 -4
  91. package/src/infrastructure/ui/views/return/Return.tsx +8 -1
  92. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +2 -6
  93. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +33 -38
@@ -1,14 +1,25 @@
1
1
  import React, { FC, memo } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
3
4
  import { useReturnQuestionItem } from "./behaviors/useReturnQuestionItem";
4
5
 
6
+ interface ReturnQuestionStyle {
7
+ readonly modal: StyleProp<ViewStyle>;
8
+ }
9
+
5
10
  interface ReturnQuestionProps {
6
11
  readonly returnQuestionParent: ReturnQuestionProjection;
7
12
  readonly returnQuestion: ReturnQuestionProjection;
8
13
  readonly portalHostName?: string;
14
+ readonly style?: Partial<ReturnQuestionStyle>;
9
15
  }
10
16
 
11
- const ReturnQuestion: FC<ReturnQuestionProps> = ({ returnQuestionParent, returnQuestion, portalHostName }) => {
17
+ const ReturnQuestion: FC<ReturnQuestionProps> = ({
18
+ returnQuestionParent,
19
+ returnQuestion,
20
+ portalHostName,
21
+ style: customStyle,
22
+ }) => {
12
23
  const Item = useReturnQuestionItem({ type: returnQuestion.type });
13
24
 
14
25
  return (
@@ -16,6 +27,7 @@ const ReturnQuestion: FC<ReturnQuestionProps> = ({ returnQuestionParent, returnQ
16
27
  portalHostName={portalHostName}
17
28
  returnQuestion={returnQuestion}
18
29
  returnQuestionParent={returnQuestionParent}
30
+ style={customStyle}
19
31
  testID={returnQuestion.id}
20
32
  >
21
33
  <>
@@ -25,6 +37,7 @@ const ReturnQuestion: FC<ReturnQuestionProps> = ({ returnQuestionParent, returnQ
25
37
  portalHostName={portalHostName}
26
38
  returnQuestion={childReturnQuestion}
27
39
  returnQuestionParent={returnQuestion}
40
+ style={customStyle}
28
41
  />
29
42
  ))}
30
43
  </>
@@ -1,13 +1,19 @@
1
1
  import React, { FC } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
3
4
  import ReturnQuestion from "./ReturnQuestion";
4
5
 
6
+ interface ReturnQuestionsStyle {
7
+ readonly modal: StyleProp<ViewStyle>;
8
+ }
9
+
5
10
  interface ReturnQuestionsProps {
6
11
  readonly returnQuestions: ReturnQuestionProjection[];
7
12
  readonly portalHostName?: string;
13
+ readonly style?: Partial<ReturnQuestionsStyle>;
8
14
  }
9
15
 
10
- const ReturnQuestions: FC<ReturnQuestionsProps> = ({ returnQuestions, portalHostName }) => (
16
+ const ReturnQuestions: FC<ReturnQuestionsProps> = ({ returnQuestions, portalHostName, style: customStyle }) => (
11
17
  <>
12
18
  {returnQuestions.map((returnQuestion: ReturnQuestionProjection) => (
13
19
  <ReturnQuestion
@@ -15,6 +21,7 @@ const ReturnQuestions: FC<ReturnQuestionsProps> = ({ returnQuestions, portalHost
15
21
  portalHostName={portalHostName}
16
22
  returnQuestion={returnQuestion}
17
23
  returnQuestionParent={{} as ReturnQuestionProjection}
24
+ style={customStyle}
18
25
  />
19
26
  ))}
20
27
  </>
@@ -1,12 +1,18 @@
1
1
  import { FC, ReactNode } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
3
4
 
5
+ interface ReturnQuestionItemStyle {
6
+ readonly modal: StyleProp<ViewStyle>;
7
+ }
8
+
4
9
  interface ReturnQuestionItemProps {
5
10
  readonly returnQuestionParent: ReturnQuestionProjection;
6
11
  readonly returnQuestion: ReturnQuestionProjection;
7
12
  readonly children?: ReactNode;
8
13
  readonly portalHostName?: string;
9
14
  readonly testID?: string;
15
+ readonly style?: Partial<ReturnQuestionItemStyle>;
10
16
  }
11
17
 
12
18
  type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
@@ -14,7 +14,7 @@ const style = StyleSheet.create({
14
14
  header: {
15
15
  justifyContent: "space-between",
16
16
  },
17
- modalContent: {
17
+ modal: {
18
18
  paddingBottom: space6,
19
19
  paddingHorizontal: space6,
20
20
  },
@@ -20,6 +20,7 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem = ({
20
20
  children,
21
21
  portalHostName,
22
22
  testID,
23
+ style: customStyle,
23
24
  }: ReturnQuestionItemProps) => {
24
25
  const { formatMessage } = useIntl();
25
26
  const placeholderText = useMemo(
@@ -90,7 +91,7 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem = ({
90
91
  showCloseButton
91
92
  onClose={handleOnModalClose}
92
93
  >
93
- <View style={style.modalContent}>{children}</View>
94
+ <View style={[style.modal, customStyle?.modal]}>{children}</View>
94
95
  </Modal>
95
96
  </>
96
97
  );
@@ -5,6 +5,7 @@ import { ReturnQuestionItem, ReturnQuestionItemProps } from "../../ReturnQuestio
5
5
  const HostStackReturnQuestionItem: ReturnQuestionItem = ({
6
6
  returnQuestion,
7
7
  portalHostName,
8
+ style: customStyle,
8
9
  }: ReturnQuestionItemProps) => (
9
10
  <>
10
11
  {returnQuestion.children?.map((childReturnQuestion) => (
@@ -13,6 +14,7 @@ const HostStackReturnQuestionItem: ReturnQuestionItem = ({
13
14
  portalHostName={portalHostName}
14
15
  returnQuestion={childReturnQuestion}
15
16
  returnQuestionParent={returnQuestion}
17
+ style={customStyle}
16
18
  />
17
19
  ))}
18
20
  </>
@@ -12,6 +12,7 @@ const HostStackReturnQuestionItem: ReturnQuestionItem = ({
12
12
  returnQuestion,
13
13
  children,
14
14
  portalHostName,
15
+ style: customStyle,
15
16
  }: ReturnQuestionItemProps) => {
16
17
  const { formatMessage } = useIntl();
17
18
  const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
@@ -59,6 +60,7 @@ const HostStackReturnQuestionItem: ReturnQuestionItem = ({
59
60
  portalHostName={portalHostName}
60
61
  returnQuestion={childReturnQuestion}
61
62
  returnQuestionParent={feedbackReturnQuestion}
63
+ style={customStyle}
62
64
  />
63
65
  ))}
64
66
  </>
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { View } from "react-native";
2
+ import { StyleProp, View, ViewStyle } from "react-native";
3
3
  import { COLOR, Text } from "@lookiero/aurora";
4
4
  import { useIntl } from "@lookiero/i18n-react";
5
5
  import { Modal } from "@lookiero/sty-psp-ui";
@@ -12,6 +12,7 @@ interface ModalOptionReturnQuestionItemsProps {
12
12
  readonly returnQuestion: ReturnQuestionProjection;
13
13
  readonly returnQuestionParent: ReturnQuestionProjection;
14
14
  readonly visible: boolean;
15
+ readonly style?: StyleProp<ViewStyle>;
15
16
  readonly onClose: () => void;
16
17
  }
17
18
 
@@ -19,6 +20,7 @@ const ModalOptionReturnQuestionItems = ({
19
20
  portalHostName,
20
21
  returnQuestion,
21
22
  visible,
23
+ style: customStyle,
22
24
  onClose,
23
25
  }: ModalOptionReturnQuestionItemsProps) => {
24
26
  const { formatMessage } = useIntl();
@@ -26,7 +28,7 @@ const ModalOptionReturnQuestionItems = ({
26
28
 
27
29
  return (
28
30
  <Modal portalHostName={portalHostName} visible={visible} scroll showCloseButton onClose={onClose}>
29
- <View style={style.modalContent}>
31
+ <View style={[style.modalContent, customStyle]}>
30
32
  <Text color={COLOR.TEXT_MEDIUM} level={2} style={style.optionText}>
31
33
  {title}
32
34
  </Text>
@@ -37,6 +39,7 @@ const ModalOptionReturnQuestionItems = ({
37
39
  portalHostName=""
38
40
  returnQuestion={childReturnQuestion}
39
41
  returnQuestionParent={returnQuestion}
42
+ style={{ modal: customStyle }}
40
43
  />
41
44
  ))}
42
45
  </>
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useState } from "react";
2
- import { View, Option, OPTION_VARIANT, SIZE } from "@lookiero/aurora";
2
+ import { View, Option, OPTION_VARIANT } from "@lookiero/aurora";
3
3
  import { useIntl } from "@lookiero/i18n-react";
4
4
  import {
5
5
  useReturnQuestionFeedback,
@@ -18,6 +18,7 @@ const RadioReturnQuestionItem: ReturnQuestionItem = ({
18
18
  returnQuestionParent,
19
19
  testID,
20
20
  portalHostName,
21
+ style: customStyle,
21
22
  }: ReturnQuestionItemProps) => {
22
23
  const intl = useIntl();
23
24
  const [modalVisible, setModalVisible] = useState(false);
@@ -74,7 +75,6 @@ const RadioReturnQuestionItem: ReturnQuestionItem = ({
74
75
  <View style={style.wrapper} testID={testID}>
75
76
  <Option
76
77
  checked={returnQuestion.id === feedbackId}
77
- flex={SIZE.XS}
78
78
  name={returnQuestion.id}
79
79
  title={inputValue ? `${optionText} / ${inputValue}` : `${optionText}`}
80
80
  value={returnQuestion.id}
@@ -87,6 +87,7 @@ const RadioReturnQuestionItem: ReturnQuestionItem = ({
87
87
  portalHostName={portalHostName}
88
88
  returnQuestion={returnQuestion}
89
89
  returnQuestionParent={returnQuestion}
90
+ style={customStyle?.modal}
90
91
  visible={modalVisible}
91
92
  onClose={handleOnModalClose}
92
93
  />
@@ -1,4 +1,5 @@
1
1
  import React, { FC, memo, Suspense } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  import { Navigate, Outlet, useRoutes as reactRouterUseRoutes } from "react-router-native";
3
4
  import { Spinner } from "@lookiero/aurora";
4
5
  import { I18n } from "@lookiero/i18n-react";
@@ -10,7 +11,7 @@ import { Order } from "../../../projection/order/order";
10
11
  import { Subscription } from "../../../projection/subscription/subscription";
11
12
  import { KameleoonEnvironment } from "../../ab-testing/kameleoonEnvironment";
12
13
  import { StaticInfoProvider } from "../hooks/useStaticInfo";
13
- import { App } from "../views/App";
14
+ import { App, AppStyle } from "../views/App";
14
15
  import { Checkout } from "../views/checkout/Checkout";
15
16
  import { CheckoutPaymentModal } from "../views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal";
16
17
  import { Feedback } from "../views/feedback/Feedback";
@@ -22,6 +23,10 @@ import { CheckoutMiddleware } from "./CheckoutMiddleware";
22
23
  import { Routes } from "./routes";
23
24
  import { BasePathProvider } from "./useBasePath";
24
25
 
26
+ interface RoutingStyle extends AppStyle {
27
+ readonly modal: StyleProp<ViewStyle>;
28
+ }
29
+
25
30
  interface RoutingProps {
26
31
  readonly basePath?: string;
27
32
  readonly customer: Customer;
@@ -31,6 +36,7 @@ interface RoutingProps {
31
36
  readonly I18n: I18n;
32
37
  readonly kameleoon: KameleoonEnvironment;
33
38
  readonly layout: Layout;
39
+ readonly style?: Partial<RoutingStyle>;
34
40
  readonly getAuthToken: () => Promise<string>;
35
41
  readonly onNotAccessible: () => void;
36
42
  readonly onCheckoutSubmitted?: () => void;
@@ -48,6 +54,7 @@ const Routing: FC<RoutingProps> = ({
48
54
  I18n,
49
55
  kameleoon,
50
56
  layout,
57
+ style: customStyle,
51
58
  getAuthToken,
52
59
  onI18nError,
53
60
  onNotAccessible,
@@ -64,7 +71,7 @@ const Routing: FC<RoutingProps> = ({
64
71
  <I18n loader={<Spinner />} locale={locale} onError={onI18nError}>
65
72
  <Kameleoon loader={<Spinner />} siteCode={kameleoon.siteCode}>
66
73
  <CheckoutMiddleware customerId={customer?.customerId as string} onNotAccessible={onNotAccessible}>
67
- <App>
74
+ <App style={{ container: customStyle?.container, notifications: customStyle?.notifications }}>
68
75
  <Outlet />
69
76
  </App>
70
77
  </CheckoutMiddleware>
@@ -78,7 +85,7 @@ const Routing: FC<RoutingProps> = ({
78
85
  path: Routes.ITEM,
79
86
  element: (
80
87
  <Suspense fallback={<Spinner />}>
81
- <Item layout={layout} />
88
+ <Item layout={layout} style={{ modal: customStyle?.modal }} />
82
89
  </Suspense>
83
90
  ),
84
91
  },
@@ -86,7 +93,7 @@ const Routing: FC<RoutingProps> = ({
86
93
  path: Routes.ITEM_DETAIL,
87
94
  element: (
88
95
  <Suspense fallback={<Spinner />}>
89
- <Item layout={layout} />
96
+ <Item layout={layout} style={{ modal: customStyle?.modal }} />
90
97
  </Suspense>
91
98
  ),
92
99
  },
@@ -147,7 +154,7 @@ const Routing: FC<RoutingProps> = ({
147
154
  path: Routes.RETURN,
148
155
  element: (
149
156
  <Suspense fallback={<Spinner />}>
150
- <Return layout={layout} />
157
+ <Return layout={layout} style={{ modal: customStyle?.modal }} />
151
158
  </Suspense>
152
159
  ),
153
160
  },
@@ -168,3 +175,4 @@ const Routing: FC<RoutingProps> = ({
168
175
  */
169
176
  const MemoizedRouting = memo(Routing);
170
177
  export { MemoizedRouting as Routing };
178
+ export type { RoutingStyle };
@@ -0,0 +1,9 @@
1
+ import { StyleSheet } from "react-native";
2
+
3
+ const style = StyleSheet.create({
4
+ container: {
5
+ flex: 1,
6
+ },
7
+ });
8
+
9
+ export { style };
@@ -1,32 +1,42 @@
1
1
  import { PortalProvider } from "@gorhom/portal";
2
2
  import React, { FC } from "react";
3
- import { StatusBar } from "react-native";
3
+ import { StatusBar, StyleProp, View, ViewStyle } from "react-native";
4
4
  import { SafeAreaProvider } from "react-native-safe-area-context";
5
5
  import { PortalProvider as AuroraPortalProvider } from "@lookiero/aurora";
6
- import { Notifications } from "@lookiero/sty-psp-notifications";
6
+ import { Notifications, NotificationsStyle } from "@lookiero/sty-psp-notifications";
7
7
  import { theme } from "@lookiero/sty-psp-ui";
8
8
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
9
+ import { style } from "./App.style";
9
10
 
10
11
  const { colorBgBase } = theme();
11
12
 
13
+ interface AppStyle {
14
+ readonly container: StyleProp<ViewStyle>;
15
+ readonly notifications: Partial<NotificationsStyle>;
16
+ }
17
+
12
18
  interface AppProps {
13
19
  readonly children: JSX.Element;
20
+ readonly style?: Partial<AppStyle>;
14
21
  }
15
22
 
16
- const App: FC<AppProps> = ({ children }) => (
17
- <SafeAreaProvider>
18
- <PortalProvider>
19
- <StatusBar backgroundColor={colorBgBase} barStyle="dark-content" translucent />
20
- <Notifications contextId={MESSAGING_CONTEXT_ID} />
21
- {/*
23
+ const App: FC<AppProps> = ({ children, style: customStyle }) => (
24
+ <View style={[style.container, customStyle?.container]}>
25
+ <SafeAreaProvider>
26
+ <PortalProvider>
27
+ <StatusBar backgroundColor={colorBgBase} barStyle="dark-content" translucent />
28
+ <Notifications contextId={MESSAGING_CONTEXT_ID} style={customStyle?.notifications} />
29
+ {/*
22
30
  We are using the Aurora's PortalProvider at this level for notifications to work properly.
23
31
 
24
32
  PaymentInstrumentSelect uses Aurora's Portal, and if we rely on UAF's Portal (injected by <Aurora>)
25
33
  notifications would be displayed in a layer below Portal's one (not visible).
26
34
  */}
27
- <AuroraPortalProvider>{children}</AuroraPortalProvider>
28
- </PortalProvider>
29
- </SafeAreaProvider>
35
+ <AuroraPortalProvider>{children}</AuroraPortalProvider>
36
+ </PortalProvider>
37
+ </SafeAreaProvider>
38
+ </View>
30
39
  );
31
40
 
41
+ export type { AppStyle };
32
42
  export { App };
@@ -1,4 +1,5 @@
1
1
  import React, { FC, useCallback, useEffect, useMemo, useRef } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
3
4
  import { Box, Spinner } from "@lookiero/aurora";
4
5
  import { QueryStatus } from "@lookiero/messaging-react";
@@ -54,11 +55,16 @@ interface HandleOnPreviousFunction {
54
55
  (args: HandleOnPreviousFunctionArgs): void;
55
56
  }
56
57
 
58
+ interface ItemStyle {
59
+ readonly modal: StyleProp<ViewStyle>;
60
+ }
61
+
57
62
  interface ItemProps {
58
63
  readonly layout: Layout;
64
+ readonly style?: Partial<ItemStyle>;
59
65
  }
60
66
 
61
- const Item: FC<ItemProps> = ({ layout: Layout }) => {
67
+ const Item: FC<ItemProps> = ({ layout: Layout, style: customStyle }) => {
62
68
  const logger = useLogger();
63
69
  const screenSize = useScreenSize();
64
70
  const navigate = useNavigate();
@@ -218,7 +224,6 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
218
224
  return (
219
225
  <ReturnQuestionFeedbackProvider key={checkoutItem.id} feedback={checkoutItem.feedbacks || {}}>
220
226
  <Layout
221
- footer={null}
222
227
  header={header}
223
228
  scrollEnabled={!itemWithoutCustomerDecission}
224
229
  style={{
@@ -233,6 +238,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
233
238
  checkoutId={checkout.id}
234
239
  checkoutItem={checkoutItem as CheckoutItemWithoutCustomerDecission}
235
240
  currentProductVariant={currentProductVariant}
241
+ style={customStyle}
236
242
  onReturn={goToReturnPage}
237
243
  />
238
244
  ) : (
@@ -17,7 +17,7 @@ const style = StyleSheet.create({
17
17
  marginVertical: space8,
18
18
  width: "100%",
19
19
  },
20
- modalContent: {
20
+ modal: {
21
21
  paddingHorizontal: space6,
22
22
  },
23
23
  title: {
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from "react";
2
- import { View } from "react-native";
2
+ import { StyleProp, View, ViewStyle } from "react-native";
3
3
  import { ALIGN, Button, BUTTON_VARIANT, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
5
  import { Modal } from "@lookiero/sty-psp-ui";
@@ -8,10 +8,16 @@ import { style } from "./GetOutOfCheckoutModal.style";
8
8
 
9
9
  interface GetOutOfCheckoutModalProps {
10
10
  readonly visible: boolean;
11
+ readonly style?: StyleProp<ViewStyle>;
11
12
  readonly onDismiss: () => void;
12
13
  readonly onConfirm: () => void;
13
14
  }
14
- const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps> = ({ visible, onDismiss, onConfirm }) => {
15
+ const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps> = ({
16
+ visible,
17
+ style: customStyle,
18
+ onDismiss,
19
+ onConfirm,
20
+ }) => {
15
21
  const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
16
22
  const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
17
23
  const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
@@ -19,7 +25,7 @@ const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps> = ({ visible, onDism
19
25
 
20
26
  return (
21
27
  <Modal visible={visible} onClose={onDismiss}>
22
- <View style={style.modalContent}>
28
+ <View style={[style.modal, customStyle]}>
23
29
  <Text align={ALIGN.CENTER} level={1} style={style.title}>
24
30
  {titleText}
25
31
  </Text>
@@ -1,5 +1,5 @@
1
1
  import React, { FC, useCallback, useMemo, useState } from "react";
2
- import { LayoutRectangle, View } from "react-native";
2
+ import { LayoutRectangle, StyleProp, View, ViewStyle } from "react-native";
3
3
  import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
5
  import { Country } from "@lookiero/sty-psp-locale";
@@ -11,10 +11,15 @@ import { I18nMessages } from "../../../../i18n/i18n";
11
11
  import { SelectModal } from "../selectModal/SelectModal";
12
12
  import { style } from "./ItemActions.style";
13
13
 
14
+ interface ItemActionsStyle {
15
+ readonly modal: StyleProp<ViewStyle>;
16
+ }
17
+
14
18
  interface ItemActionsProps {
15
19
  readonly productVariants?: ProductVariantProjection[];
16
20
  readonly currentProductVariant: ProductVariantProjection;
17
21
  readonly country: Country;
22
+ readonly style?: Partial<ItemActionsStyle>;
18
23
  readonly onShowSizeWithoutStockModal?: () => void;
19
24
  readonly onKeep: () => void;
20
25
  readonly onReturn: () => void;
@@ -25,6 +30,7 @@ const ItemActions: FC<ItemActionsProps> = ({
25
30
  productVariants,
26
31
  currentProductVariant,
27
32
  country,
33
+ style: customStyle,
28
34
  onShowSizeWithoutStockModal = () => void 0,
29
35
  onKeep,
30
36
  onReplace,
@@ -96,6 +102,7 @@ const ItemActions: FC<ItemActionsProps> = ({
96
102
  <SelectModal
97
103
  modalVisible={modalVisible}
98
104
  options={sizeSelectorOptions}
105
+ style={{ modal: customStyle?.modal }}
99
106
  testID="select-field-modal"
100
107
  title={changeSizeButtonText}
101
108
  value={currentProductVariant.id}
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from "react";
2
- import { View } from "react-native";
2
+ import { StyleProp, View, ViewStyle } from "react-native";
3
3
  import { ButtonIcon, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
5
  import {
@@ -25,12 +25,21 @@ const returnQuestionItems: ReturnQuestionItems = {
25
25
  [ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
26
26
  };
27
27
 
28
+ interface ReturnQuestionsFeedbackStyle {
29
+ readonly modal: StyleProp<ViewStyle>;
30
+ }
31
+
28
32
  interface ReturnQuestionsFeedbackProps {
29
33
  readonly returnQuestions: ReturnQuestionProjection[];
34
+ readonly style?: Partial<ReturnQuestionsFeedbackStyle>;
30
35
  readonly onEditFeedback: () => void;
31
36
  }
32
37
 
33
- const ReturnQuestionsFeedback: FC<ReturnQuestionsFeedbackProps> = ({ returnQuestions, onEditFeedback }) => {
38
+ const ReturnQuestionsFeedback: FC<ReturnQuestionsFeedbackProps> = ({
39
+ returnQuestions,
40
+ style: customStyle,
41
+ onEditFeedback,
42
+ }) => {
34
43
  const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE });
35
44
 
36
45
  return (
@@ -41,7 +50,7 @@ const ReturnQuestionsFeedback: FC<ReturnQuestionsFeedbackProps> = ({ returnQuest
41
50
  </View>
42
51
 
43
52
  <ReturnQuestionItemProvider returnQuestionItems={returnQuestionItems}>
44
- <ReturnQuestions returnQuestions={returnQuestions} />
53
+ <ReturnQuestions returnQuestions={returnQuestions} style={customStyle} />
45
54
  </ReturnQuestionItemProvider>
46
55
  </View>
47
56
  );
@@ -4,7 +4,7 @@ import { theme } from "@lookiero/sty-psp-ui";
4
4
  const { borderWidth1, colorBorderInteractive, space1, space5, space6 } = theme();
5
5
 
6
6
  const style = StyleSheet.create({
7
- modalContent: {
7
+ modal: {
8
8
  paddingBottom: space6,
9
9
  paddingHorizontal: space6,
10
10
  },
@@ -7,7 +7,7 @@ import { style } from "./SelectModal.style";
7
7
  const { colorBgPrimaryLight } = theme();
8
8
 
9
9
  interface SelectModalStyle {
10
- readonly modalContent: StyleProp<ViewStyle>;
10
+ readonly modal: StyleProp<ViewStyle>;
11
11
  readonly option: StyleProp<ViewStyle>;
12
12
  readonly optionText: StyleProp<TextStyle>;
13
13
  }
@@ -22,21 +22,21 @@ interface SelectModalProps {
22
22
  readonly value: string | undefined;
23
23
  readonly options: Option[];
24
24
  readonly style?: Partial<SelectModalStyle>;
25
- readonly onChange?: (value: string) => void;
26
- readonly onClose?: () => void;
27
25
  readonly modalVisible: boolean;
28
26
  readonly testID?: string;
27
+ readonly onChange?: (value: string) => void;
28
+ readonly onClose?: () => void;
29
29
  }
30
30
 
31
31
  const SelectModal: FC<SelectModalProps> = ({
32
32
  modalVisible,
33
- onChange = () => void 0,
34
- onClose = () => void 0,
35
33
  options,
36
34
  style: customStyle,
37
35
  testID,
38
36
  title,
39
37
  value,
38
+ onChange = () => void 0,
39
+ onClose = () => void 0,
40
40
  }) => {
41
41
  const handleOnPressOption = useCallback(
42
42
  (value: string) => {
@@ -48,7 +48,7 @@ const SelectModal: FC<SelectModalProps> = ({
48
48
 
49
49
  return (
50
50
  <Modal testID={testID} visible={modalVisible} scroll showCloseButton onClose={onClose}>
51
- <View style={[style.modalContent, customStyle?.modalContent]}>
51
+ <View style={[style.modal, customStyle?.modal]}>
52
52
  {title && (
53
53
  <Text level={3} style={style.modalTitle} heading>
54
54
  {title}
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from "react";
2
- import { View } from "react-native";
2
+ import { StyleProp, View, ViewStyle } from "react-native";
3
3
  import { Button, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
5
  import { Modal } from "@lookiero/sty-psp-ui";
@@ -8,16 +8,17 @@ import { style } from "./SizeWithoutStockModal.style";
8
8
 
9
9
  interface SizeWithoutStockModalProps {
10
10
  readonly visible: boolean;
11
+ readonly style?: StyleProp<ViewStyle>;
11
12
  readonly onDismiss: () => void;
12
13
  }
13
- const SizeWithoutStockModal: FC<SizeWithoutStockModalProps> = ({ visible, onDismiss }) => {
14
+ const SizeWithoutStockModal: FC<SizeWithoutStockModalProps> = ({ visible, style: customStyle, onDismiss }) => {
14
15
  const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
15
16
  const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
16
17
  const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
17
18
 
18
19
  return (
19
20
  <Modal visible={visible} showCloseButton onClose={onDismiss}>
20
- <View style={style.modalContent}>
21
+ <View style={[style.modalContent, customStyle]}>
21
22
  <Text level={3} style={style.title} heading>
22
23
  {titleText}
23
24
  </Text>
@@ -1,5 +1,5 @@
1
1
  import React, { FC, useCallback } from "react";
2
- import { View } from "react-native";
2
+ import { StyleProp, View, ViewStyle } from "react-native";
3
3
  import { Spinner } from "@lookiero/aurora";
4
4
  import { CommandStatus } from "@lookiero/messaging-react";
5
5
  import { useLogger } from "@lookiero/sty-psp-logging";
@@ -21,6 +21,10 @@ import { ReturnQuestionsFeedback } from "../../components/returnQuestionsFeedbac
21
21
  import { ProductVariant } from "../../views/productVariant/ProductVariant";
22
22
  import { style } from "./ItemWithCustomerDecission.style";
23
23
 
24
+ interface ItemWithCustomerDecissionStyle {
25
+ readonly modal: StyleProp<ViewStyle>;
26
+ }
27
+
24
28
  interface CheckoutItemWithCustomerDecission extends CheckoutItemProjection {
25
29
  readonly status: Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL>;
26
30
  }
@@ -30,6 +34,7 @@ interface ItemWithCustomerDecissionProps {
30
34
  readonly checkoutItem: CheckoutItemWithCustomerDecission;
31
35
  readonly returnQuestions: ReturnQuestionProjection[];
32
36
  readonly currentProductVariant: ProductVariantProjection;
37
+ readonly style?: Partial<ItemWithCustomerDecissionStyle>;
33
38
  readonly onEditFeedback: () => void;
34
39
  }
35
40
 
@@ -38,6 +43,7 @@ const ItemWithCustomerDecission: FC<ItemWithCustomerDecissionProps> = ({
38
43
  checkoutItem,
39
44
  returnQuestions,
40
45
  currentProductVariant,
46
+ style: customStyle,
41
47
  onEditFeedback,
42
48
  }) => {
43
49
  const screenSize = useScreenSize();
@@ -88,7 +94,11 @@ const ItemWithCustomerDecission: FC<ItemWithCustomerDecissionProps> = ({
88
94
  >
89
95
  {checkoutItem.status === CheckoutItemStatus.RETURNED && (
90
96
  <View style={[style.feedbackContainer, isMobile ? style.feedbackContainerMobile : undefined]}>
91
- <ReturnQuestionsFeedback returnQuestions={returnQuestions} onEditFeedback={onEditFeedback} />
97
+ <ReturnQuestionsFeedback
98
+ returnQuestions={returnQuestions}
99
+ style={customStyle}
100
+ onEditFeedback={onEditFeedback}
101
+ />
92
102
  </View>
93
103
  )}
94
104
  </ProductVariant>