@lookiero/checkout 0.6.0-beta.9 → 0.6.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 (90) hide show
  1. package/README.md +9 -0
  2. package/dist/index.d.ts +2 -4
  3. package/dist/index.js +2 -2
  4. package/dist/infrastructure/tracking/tracking.d.ts +9 -0
  5. package/dist/infrastructure/tracking/tracking.js +10 -0
  6. package/dist/infrastructure/ui/Root.d.ts +2 -4
  7. package/dist/infrastructure/ui/Root.js +6 -16
  8. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +2 -1
  9. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +6 -0
  10. package/dist/infrastructure/ui/{views/header/components/Logo.style.js → components/templates/SafeAreaScrollView.style.ts.js} +2 -3
  11. package/dist/infrastructure/ui/i18n/i18n.d.ts +3 -1
  12. package/dist/infrastructure/ui/i18n/i18n.js +2 -0
  13. package/dist/infrastructure/ui/routing/Routing.js +8 -2
  14. package/dist/infrastructure/ui/views/App.js +4 -10
  15. package/dist/infrastructure/ui/views/checkout/Checkout.js +12 -5
  16. package/dist/infrastructure/ui/views/checkout/Checkout.style.d.ts +0 -3
  17. package/dist/infrastructure/ui/views/checkout/Checkout.style.js +0 -3
  18. package/dist/infrastructure/ui/views/feedback/Feedback.d.ts +2 -0
  19. package/dist/infrastructure/ui/views/feedback/Feedback.js +9 -2
  20. package/dist/infrastructure/ui/views/feedback/Feedback.style.d.ts +0 -3
  21. package/dist/infrastructure/ui/views/feedback/Feedback.style.js +0 -3
  22. package/dist/infrastructure/ui/views/intro/Intro.js +1 -1
  23. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -3
  24. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -3
  25. package/dist/infrastructure/ui/views/item/Item.js +9 -1
  26. package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -3
  27. package/dist/infrastructure/ui/views/item/Item.style.js +0 -3
  28. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +1 -0
  29. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +6 -1
  30. package/dist/infrastructure/ui/views/notFound/NotFound.d.ts +8 -0
  31. package/dist/infrastructure/ui/views/notFound/NotFound.js +43 -0
  32. package/dist/infrastructure/ui/views/notFound/NotFound.style.d.ts +16 -0
  33. package/dist/infrastructure/ui/views/notFound/NotFound.style.js +19 -0
  34. package/dist/infrastructure/ui/views/summary/Summary.js +8 -1
  35. package/dist/infrastructure/ui/views/summary/Summary.style.d.ts +0 -3
  36. package/dist/infrastructure/ui/views/summary/Summary.style.js +0 -3
  37. package/dist/public/images/not-found.png +0 -0
  38. package/dist/shared/tracking/infrastructure/useEmitUserEvent.d.ts +6 -0
  39. package/dist/shared/tracking/infrastructure/useEmitUserEvent.js +7 -0
  40. package/dist/shared/tracking/infrastructure/usePageView.d.ts +13 -0
  41. package/dist/shared/tracking/infrastructure/usePageView.js +21 -0
  42. package/dist/shared/tracking/tracking.d.ts +19 -0
  43. package/dist/shared/tracking/tracking.js +9 -0
  44. package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +12 -0
  45. package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
  46. package/dist/shared/ui/components/atoms/field/Field.js +13 -5
  47. package/dist/shared/ui/components/atoms/field/Field.style.js +2 -2
  48. package/dist/shared/ui/components/molecules/inputField/InputField.js +2 -2
  49. package/dist/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -1
  50. package/dist/shared/ui/components/molecules/inputField/InputField.style.js +0 -1
  51. package/package.json +13 -9
  52. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +0 -13
  53. package/dist/domain/checkout/command/markCheckoutAsPaid.js +0 -4
  54. package/dist/domain/checkout/model/checkoutPaid.d.ts +0 -13
  55. package/dist/domain/checkout/model/checkoutPaid.js +0 -4
  56. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +0 -5
  57. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +0 -13
  58. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +0 -13
  59. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +0 -16
  60. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -13
  61. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +0 -14
  62. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
  63. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +0 -9
  64. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
  65. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +0 -12
  66. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +0 -12
  67. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +0 -9
  68. package/dist/infrastructure/ui/views/App.style.d.ts +0 -4
  69. package/dist/infrastructure/ui/views/App.style.js +0 -16
  70. package/dist/infrastructure/ui/views/header/Header.d.ts +0 -15
  71. package/dist/infrastructure/ui/views/header/Header.js +0 -90
  72. package/dist/infrastructure/ui/views/header/Header.style.d.ts +0 -35
  73. package/dist/infrastructure/ui/views/header/Header.style.js +0 -38
  74. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +0 -7
  75. package/dist/infrastructure/ui/views/header/components/Logo.js +0 -11
  76. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +0 -7
  77. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -10
  78. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +0 -1
  79. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
  80. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
  81. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +0 -25
  82. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +0 -8
  83. package/dist/shared/logging/SentryDependencies.d.ts +0 -4
  84. package/dist/shared/logging/SentryDependencies.js +0 -4
  85. package/dist/shared/logging/SentryDependencies.native.d.ts +0 -2
  86. package/dist/shared/logging/SentryDependencies.native.js +0 -2
  87. package/dist/shared/logging/SentryLogger.d.ts +0 -14
  88. package/dist/shared/logging/SentryLogger.js +0 -50
  89. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
  90. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +0 -9
package/README.md CHANGED
@@ -26,6 +26,15 @@ Once we can replace the build of Jenkins for NPM one, we are going to be able to
26
26
  ```json
27
27
  {
28
28
  (...)
29
+ "scripts": {
30
+ (...)
31
+ // Remove
32
+ "build": "tsc -b tsconfig.build.json && cp -R ./src/public/ ./dist/public",
33
+ // Add
34
+ "build": "tsc -b tsconfig.build.json && npm run copy:assets",
35
+ "copy:assets": "cp -R ./src/public/ ./dist/public",
36
+ (...)
37
+ },
29
38
  "dependencies": {
30
39
  (...)
31
40
  "@expo/dev-server": "0.1.120",
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { EndpointFunction } from "@lookiero/i18n";
2
- import { ComponentType } from "react";
2
+ import { FC } from "react";
3
3
  import { RootProps } from "./infrastructure/ui/Root";
4
4
  import { IsCheckoutAccessibleByCustomerIdProjection } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
5
- import { SentryLoggerFunctionArgs } from "./shared/logging/SentryLogger";
6
5
  interface IsCheckoutAccessibleFunctionArgs {
7
6
  readonly customerId: string | undefined;
8
7
  }
@@ -13,10 +12,9 @@ interface BootstrapFunctionArgs {
13
12
  readonly getAuthToken: () => Promise<string>;
14
13
  readonly apiUrl: string;
15
14
  readonly translations: EndpointFunction;
16
- readonly sentry: SentryLoggerFunctionArgs;
17
15
  }
18
16
  interface BootstrapFunctionReturn {
19
- readonly Root: ComponentType<RootProps>;
17
+ readonly Root: FC<RootProps>;
20
18
  readonly isCheckoutAccessible: IsCheckoutAccessibleFunction;
21
19
  }
22
20
  interface BootstrapFunction {
package/dist/index.js CHANGED
@@ -3,13 +3,13 @@ import { i18n } from "@lookiero/i18n-react";
3
3
  import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
4
4
  import { root } from "./infrastructure/ui/Root";
5
5
  import { viewIsCheckoutAccessibleByCustomerId, } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
6
- const bootstrap = ({ apiUrl, getAuthToken, translations, sentry }) => {
6
+ const bootstrap = ({ apiUrl, getAuthToken, translations }) => {
7
7
  const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
8
8
  const I18n = i18n({
9
9
  fetchTranslation: fetchFetchTranslation({ endpoint: translations }),
10
10
  contextId: "CheckoutI18n",
11
11
  });
12
- const Root = root({ Messaging, I18n, getAuthToken, sentry });
12
+ const Root = root({ Messaging, I18n, getAuthToken });
13
13
  const isCheckoutAccessible = ({ customerId }) => queryBus(viewIsCheckoutAccessibleByCustomerId({ customerId }));
14
14
  return {
15
15
  Root,
@@ -0,0 +1,9 @@
1
+ declare const PROJECT = "checkout";
2
+ declare enum TrackingPage {
3
+ ITEM = "item",
4
+ CHECKOUT = "checkout",
5
+ SUMMARY = "summary",
6
+ FEEDBACK = "feedback",
7
+ NOT_FOUND = "not_found"
8
+ }
9
+ export { PROJECT, TrackingPage };
@@ -0,0 +1,10 @@
1
+ const PROJECT = "checkout";
2
+ var TrackingPage;
3
+ (function (TrackingPage) {
4
+ TrackingPage["ITEM"] = "item";
5
+ TrackingPage["CHECKOUT"] = "checkout";
6
+ TrackingPage["SUMMARY"] = "summary";
7
+ TrackingPage["FEEDBACK"] = "feedback";
8
+ TrackingPage["NOT_FOUND"] = "not_found";
9
+ })(TrackingPage || (TrackingPage = {}));
10
+ export { PROJECT, TrackingPage };
@@ -1,18 +1,16 @@
1
1
  import { I18n } from "@lookiero/i18n-react";
2
2
  import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
3
- import { ComponentType } from "react";
3
+ import { FC } from "react";
4
4
  import { Customer } from "../../projection/shared/customer";
5
- import { SentryLoggerFunctionArgs } from "../../shared/logging/SentryLogger";
6
5
  import { Menu, TabBar } from "./views/navigation/Navigation";
7
6
  interface RootFunctionArgs {
8
7
  readonly Messaging: MessagingRoot;
9
8
  readonly I18n: I18n;
10
9
  readonly development?: boolean;
11
- readonly sentry?: SentryLoggerFunctionArgs;
12
10
  readonly getAuthToken: () => Promise<string>;
13
11
  }
14
12
  interface RootFunction {
15
- (args: RootFunctionArgs): ComponentType<RootProps>;
13
+ (args: RootFunctionArgs): FC<RootProps>;
16
14
  }
17
15
  interface RootProps {
18
16
  readonly basePath: string;
@@ -1,21 +1,11 @@
1
1
  import React, { useCallback } from "react";
2
2
  import { Platform } from "react-native";
3
- import { sentryLogger } from "../../shared/logging/SentryLogger";
4
3
  import { Routing } from "./routing/Routing";
5
- const root = ({ Messaging, I18n, getAuthToken, development, sentry }) => {
6
- // eslint-disable-next-line react/display-name, react/prop-types
7
- const Root = ({ basePath, locale = "en", customer, menu, tabBar, onNotAccessible, useRedirect }) => {
8
- const handleOnI18nError = useCallback(() => void 0, []);
9
- return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
10
- React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, locale: locale, menu: menu, tabBar: tabBar, useRedirect: useRedirect, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible })));
11
- };
12
- return sentry
13
- ? sentryLogger({
14
- publicKey: sentry.publicKey,
15
- environment: sentry.environment,
16
- release: sentry.release,
17
- project: sentry.project,
18
- })(Root)
19
- : Root;
4
+ const root = ({ Messaging, I18n, getAuthToken, development }) =>
5
+ // eslint-disable-next-line react/display-name, react/prop-types
6
+ ({ basePath, locale = "en", customer, menu, tabBar, onNotAccessible, useRedirect }) => {
7
+ const handleOnI18nError = useCallback(() => void 0, []);
8
+ return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
9
+ React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, locale: locale, menu: menu, tabBar: tabBar, useRedirect: useRedirect, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible })));
20
10
  };
21
11
  export { root };
@@ -2,10 +2,11 @@ import React from "react";
2
2
  import { Platform, ScrollView } from "react-native";
3
3
  import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import { theme } from "../../theme/theme";
5
+ import { style } from "./SafeAreaScrollView.style.ts";
5
6
  const { spaceXXXL } = theme();
6
7
  const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
7
8
  const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
8
- return (React.createElement(SafeAreaView, { edges: edges, style: customStyle?.safeAreaView },
9
+ return (React.createElement(SafeAreaView, { edges: edges, style: [style.safeAreaView, customStyle?.safeAreaView] },
9
10
  React.createElement(ScrollView, { contentContainerStyle: [
10
11
  {
11
12
  paddingTop: safeAreaInsetTop + scrollerPaddingTop,
@@ -0,0 +1,6 @@
1
+ declare const style: {
2
+ safeAreaView: {
3
+ flex: number;
4
+ };
5
+ };
6
+ export { style };
@@ -1,8 +1,7 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  const style = StyleSheet.create({
3
- logo: {
4
- height: 54,
5
- width: 217,
3
+ safeAreaView: {
4
+ flex: 1,
6
5
  },
7
6
  });
8
7
  export { style };
@@ -58,6 +58,8 @@ declare enum I18nMessages {
58
58
  HEADER_CHECKOUT_TITLE = "header.checkout_title",
59
59
  HEADER_COMPLETE_CHECKOUT_TITLE = "header.complete_checkout_title",
60
60
  FEEDBACK_BUTTON = "feedback.button",
61
- CHECKOUT_TOAST_BOOKING_EXPIRED = "checkout.toast_booking_expired"
61
+ CHECKOUT_TOAST_BOOKING_EXPIRED = "checkout.toast_booking_expired",
62
+ NOT_FOUND_DESCRIPTION = "not_found.description",
63
+ NOT_FOUND_BUTTON = "not_found.button"
62
64
  }
63
65
  export { I18nMessages, COLOR_I18N_PREFIX };
@@ -60,5 +60,7 @@ var I18nMessages;
60
60
  I18nMessages["HEADER_COMPLETE_CHECKOUT_TITLE"] = "header.complete_checkout_title";
61
61
  I18nMessages["FEEDBACK_BUTTON"] = "feedback.button";
62
62
  I18nMessages["CHECKOUT_TOAST_BOOKING_EXPIRED"] = "checkout.toast_booking_expired";
63
+ I18nMessages["NOT_FOUND_DESCRIPTION"] = "not_found.description";
64
+ I18nMessages["NOT_FOUND_BUTTON"] = "not_found.button";
63
65
  })(I18nMessages || (I18nMessages = {}));
64
66
  export { I18nMessages, COLOR_I18N_PREFIX };
@@ -12,6 +12,7 @@ const Item = lazy(() => import("../views/item/Item").then((module) => ({ default
12
12
  const Summary = lazy(() => import("../views/summary/Summary").then((module) => ({ default: module.Summary })));
13
13
  const Checkout = lazy(() => import("../views/checkout/Checkout").then((module) => ({ default: module.Checkout })));
14
14
  const Feedback = lazy(() => import("../views/feedback/Feedback").then((module) => ({ default: module.Feedback })));
15
+ const NotFound = lazy(() => import("../views/notFound/NotFound").then((module) => ({ default: module.NotFound })));
15
16
  const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthToken, onI18nError, onNotAccessible, useRedirect, }) => {
16
17
  const routes = useRoutes([
17
18
  {
@@ -58,11 +59,16 @@ const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthT
58
59
  {
59
60
  path: Routes.FEEDBACK,
60
61
  element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
61
- React.createElement(Feedback, { customerId: customer?.customerId }))),
62
+ React.createElement(Feedback, { country: customer?.country, customerId: customer?.customerId }))),
63
+ },
64
+ {
65
+ path: Routes.NOT_FOUND,
66
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
67
+ React.createElement(NotFound, { country: customer?.country, customerId: customer?.customerId }))),
62
68
  },
63
69
  {
64
70
  path: "*",
65
- element: React.createElement(Navigate, { to: `${Routes.HOME}`, replace: true }),
71
+ element: React.createElement(Navigate, { to: `${Routes.NOT_FOUND}`, replace: true }),
66
72
  },
67
73
  ],
68
74
  },
@@ -4,14 +4,8 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
4
4
  import { Notifications } from "../../../shared/notifications/infrastructure/ui/views/Notifications";
5
5
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
6
6
  import { Navigation } from "./navigation/Navigation";
7
- const a = true;
8
- const App = ({ customerId, menu, tabBar, children }) => {
9
- if (a) {
10
- throw new Error("This is an error (while integrated in UAF)");
11
- }
12
- return (React.createElement(SafeAreaProvider, null,
13
- React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
14
- React.createElement(Navigation, { customerId: customerId, menu: menu, tabBar: tabBar },
15
- React.createElement(PortalProvider, null, children))));
16
- };
7
+ const App = ({ customerId, menu, tabBar, children }) => (React.createElement(SafeAreaProvider, null,
8
+ React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
9
+ React.createElement(Navigation, { customerId: customerId, menu: menu, tabBar: tabBar },
10
+ React.createElement(PortalProvider, null, children))));
17
11
  export { App };
@@ -6,9 +6,11 @@ import React, { useCallback, useMemo, useRef } from "react";
6
6
  import { Platform, View } from "react-native";
7
7
  import { useNavigate } from "react-router-native";
8
8
  import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
9
+ import { usePageView } from "../../../../shared/tracking/infrastructure/usePageView";
9
10
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
10
11
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
11
12
  import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
13
+ import { TrackingPage } from "../../../tracking/tracking";
12
14
  import { Body } from "../../components/layouts/body/Body";
13
15
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
14
16
  import { I18nMessages } from "../../i18n/i18n";
@@ -24,6 +26,11 @@ const Checkout = ({ children, customerId, country, useRedirect }) => {
24
26
  const paymentInstrumentSelectRef = useRef(null);
25
27
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
26
28
  const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
29
+ usePageView({
30
+ page: TrackingPage.CHECKOUT,
31
+ country,
32
+ checkoutId: checkout?.id,
33
+ });
27
34
  const navigate = useNavigate();
28
35
  const basePath = useBasePath();
29
36
  const { returnUrl } = useRedirect();
@@ -38,18 +45,18 @@ const Checkout = ({ children, customerId, country, useRedirect }) => {
38
45
  if (!dependenciesLoaded)
39
46
  return React.createElement(Spinner, null);
40
47
  return (React.createElement(React.Fragment, null,
41
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container } },
48
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
42
49
  React.createElement(Body, { style: { column: style.bodyColumn } },
43
50
  hasReplacedCheckoutItem && (React.createElement(View, { style: style.deliveryBannerContainer },
44
51
  React.createElement(DeliveryBanner, null))),
45
52
  React.createElement(PaymentInstrumentSelect, { ref: paymentInstrumentSelectRef, beforeRedirect: returnUrl ? () => Promise.resolve(returnUrl) : undefined, hasError: false, hidePaymentMethods: [PaymentMethod.GOOGLE_PAY], section: Section.BOX_CHECKOUT }),
46
53
  React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
47
54
  checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, style: style.checkoutItemKept, testID: "checkout-items-kept" },
48
- React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, country: country, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, size: checkoutItem.productVariant.size, status: checkoutItem.status })))),
55
+ React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, country: country, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, status: checkoutItem.status, size: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
56
+ ? checkoutItem.replacedFor.size
57
+ : checkoutItem.productVariant.size })))),
49
58
  pricing && (React.createElement(View, { style: style.pricingContainer },
50
- React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount,
51
- // busy={submitCheckoutStatus === "loading"}
52
- collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, orderTotal: pricing.orderTotal, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onSubmit: handleOnSubmit }))))),
59
+ React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, orderTotal: pricing.orderTotal, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onSubmit: handleOnSubmit }))))),
53
60
  children));
54
61
  };
55
62
  export { Checkout };
@@ -5,9 +5,6 @@ declare const style: {
5
5
  checkoutItemKept: {
6
6
  paddingVertical: number;
7
7
  };
8
- container: {
9
- flex: number;
10
- };
11
8
  deliveryBannerContainer: {
12
9
  marginBottom: number;
13
10
  };
@@ -8,9 +8,6 @@ const style = StyleSheet.create({
8
8
  checkoutItemKept: {
9
9
  paddingVertical: spaceM,
10
10
  },
11
- container: {
12
- flex: 1,
13
- },
14
11
  deliveryBannerContainer: {
15
12
  marginBottom: spaceXXL,
16
13
  },
@@ -1,6 +1,8 @@
1
1
  import { FC } from "react";
2
+ import { Country } from "../../../../projection/shared/country";
2
3
  interface FeedbackProps {
3
4
  readonly customerId: string;
5
+ readonly country: Country;
4
6
  }
5
7
  declare const Feedback: FC<FeedbackProps>;
6
8
  export { Feedback };
@@ -1,17 +1,19 @@
1
1
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
2
2
  import React, { useCallback } from "react";
3
3
  import { Platform } from "react-native";
4
+ import { usePageView } from "../../../../shared/tracking/infrastructure/usePageView";
4
5
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
5
6
  import { useGiveCheckoutFeedback } from "../../../domain/checkoutFeedback/react/useGiveCheckoutFeedback";
6
7
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
7
8
  import { useListCheckoutQuestionsByCheckoutId } from "../../../projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId";
9
+ import { TrackingPage } from "../../../tracking/tracking";
8
10
  import { Body } from "../../components/layouts/body/Body";
9
11
  import { CheckoutQuestionFeedbackProvider } from "../../components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionFeedback";
10
12
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
11
13
  import { HEADER_HEIGHT } from "../navigation/components/header/Header.style";
12
14
  import { style } from "./Feedback.style";
13
15
  import { CheckoutQuestionsForm } from "./components/checkoutQuestionsForm/CheckoutQuestionsForm";
14
- const Feedback = ({ customerId }) => {
16
+ const Feedback = ({ customerId, country }) => {
15
17
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
16
18
  const [checkoutQuestions, checkoutQuestionsStatus] = useListCheckoutQuestionsByCheckoutId({
17
19
  checkoutId: checkout?.id,
@@ -25,12 +27,17 @@ const Feedback = ({ customerId }) => {
25
27
  }
26
28
  catch (e) { }
27
29
  }, [giveCheckoutFeedback]);
30
+ usePageView({
31
+ page: TrackingPage.FEEDBACK,
32
+ country,
33
+ checkoutId: checkout?.id,
34
+ });
28
35
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
29
36
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutStatus) && dependenciesLoadedStatuses.includes(checkoutQuestionsStatus);
30
37
  if (!dependenciesLoaded)
31
38
  return React.createElement(Spinner, null);
32
39
  return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {} },
33
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container } },
40
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
34
41
  React.createElement(Body, { style: { column: style.bodyColumn } },
35
42
  React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
36
43
  };
@@ -2,8 +2,5 @@ declare const style: {
2
2
  bodyColumn: {
3
3
  paddingHorizontal: number;
4
4
  };
5
- container: {
6
- flex: number;
7
- };
8
5
  };
9
6
  export { style };
@@ -5,8 +5,5 @@ const style = StyleSheet.create({
5
5
  bodyColumn: {
6
6
  paddingHorizontal: spaceXL,
7
7
  },
8
- container: {
9
- flex: 1,
10
- },
11
8
  });
12
9
  export { style };
@@ -30,7 +30,7 @@ const Intro = ({ customerId }) => {
30
30
  const [incrementIntroShownCount, incrementIntroShownCountStatus] = useIncrementIntroShownCount();
31
31
  if (fiveItemsDiscountStatus === QueryStatus.LOADING)
32
32
  return React.createElement(Spinner, null);
33
- return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container } },
33
+ return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
34
34
  React.createElement(Body, { style: { column: style.bodyColumn } },
35
35
  React.createElement(View, { style: style.intro },
36
36
  React.createElement(View, { style: style.content },
@@ -7,9 +7,6 @@ declare const style: {
7
7
  flexDirection: "row";
8
8
  marginVertical: number;
9
9
  };
10
- container: {
11
- flex: number;
12
- };
13
10
  content: {
14
11
  alignItems: "center";
15
12
  };
@@ -10,9 +10,6 @@ const style = StyleSheet.create({
10
10
  flexDirection: "row",
11
11
  marginVertical: spaceS,
12
12
  },
13
- container: {
14
- flex: 1,
15
- },
16
13
  content: {
17
14
  alignItems: "center",
18
15
  },
@@ -4,6 +4,7 @@ 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";
7
+ import { usePageView } from "../../../../shared/tracking/infrastructure/usePageView";
7
8
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
8
9
  import { useBookCheckoutBookingForCheckoutItem } from "../../../domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem";
9
10
  import { useKeepCheckoutItem } from "../../../domain/checkoutItem/react/useKeepCheckoutItem";
@@ -12,6 +13,7 @@ import { useReturnCheckoutItem } from "../../../domain/checkoutItem/react/useRet
12
13
  import { useViewBookedProductsVariantsForCheckoutItem } from "../../../projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem";
13
14
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
14
15
  import { useListReturnQuestionsByCheckoutItemId } from "../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
16
+ import { TrackingPage } from "../../../tracking/tracking";
15
17
  import { Body } from "../../components/layouts/body/Body";
16
18
  import { ReturnQuestionFeedbackProvider } from "../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
17
19
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
@@ -33,6 +35,12 @@ const Item = ({ customerId, country }) => {
33
35
  const { id } = useParams();
34
36
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
35
37
  const checkoutItem = checkout?.items.find((checkoutItem) => checkoutItem.id === id);
38
+ usePageView({
39
+ page: TrackingPage.ITEM,
40
+ country,
41
+ checkoutId: checkout?.id,
42
+ checkoutItemId: checkoutItem.id,
43
+ });
36
44
  const basePath = useBasePath();
37
45
  const itemRouteMatch = useMatch(`${basePath}/${Routes.ITEM}`);
38
46
  const itemDetailRouteMatch = useMatch(`${basePath}/${Routes.ITEM_DETAIL}`);
@@ -136,7 +144,7 @@ const Item = ({ customerId, country }) => {
136
144
  return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: checkoutItem.feedbacks || {} },
137
145
  React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
138
146
  React.createElement(SizeChangeModal, { visible: sizeChangeModalVisible, onDismiss: handleOnHideSizeChangeModal }),
139
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container }, footer: !customerDecissionMade && (React.createElement(ItemActions, { country: country, keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })) },
147
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, footer: !customerDecissionMade && (React.createElement(ItemActions, { country: country, keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })) },
140
148
  React.createElement(Body, null,
141
149
  customerDecissionMade && (React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: handleOnBannerPress })),
142
150
  React.createElement(View, { style: [style.content, { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight }] },
@@ -1,7 +1,4 @@
1
1
  declare const style: {
2
- container: {
3
- flex: number;
4
- };
5
2
  content: {
6
3
  paddingHorizontal: number;
7
4
  };
@@ -2,9 +2,6 @@ import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../theme/theme";
3
3
  const { borderSize, colorGrayscaleM, spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
- container: {
6
- flex: 1,
7
- },
8
5
  content: {
9
6
  paddingHorizontal: spaceXL,
10
7
  },
@@ -32,6 +32,7 @@ declare const style: {
32
32
  flexDirection: "row";
33
33
  };
34
34
  sizeChange: {
35
+ width?: string | undefined;
35
36
  backgroundColor: string;
36
37
  marginTop: number;
37
38
  paddingHorizontal: number;
@@ -1,4 +1,4 @@
1
- import { StyleSheet } from "react-native";
1
+ import { Platform, StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../theme/theme";
3
3
  const { borderSize, colorGrayscaleL, colorInfo, spaceXS, spaceS, spaceM } = theme();
4
4
  const IMAGE_WIDTH = 96;
@@ -40,6 +40,11 @@ const style = StyleSheet.create({
40
40
  marginTop: spaceM,
41
41
  paddingHorizontal: spaceS,
42
42
  paddingVertical: spaceXS,
43
+ ...Platform.select({
44
+ web: {
45
+ width: "fit-content",
46
+ },
47
+ }),
43
48
  },
44
49
  sizeChangeText: {
45
50
  textTransform: "uppercase",
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { Country } from "../../../../projection/shared/country";
3
+ interface NotFoundProps {
4
+ readonly customerId: string;
5
+ readonly country: Country;
6
+ }
7
+ declare const NotFound: FC<NotFoundProps>;
8
+ export { NotFound };
@@ -0,0 +1,43 @@
1
+ import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
+ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
3
+ import { useI18nMessage } from "@lookiero/i18n-react";
4
+ import { QueryStatus } from "@lookiero/messaging-react";
5
+ import React, { useCallback } from "react";
6
+ import { Image, Platform } from "react-native";
7
+ import { useNavigate } from "react-router-native";
8
+ import { usePageView } from "../../../../shared/tracking/infrastructure/usePageView";
9
+ import { AspectRatioView } from "../../../../shared/ui/components/atoms/aspectRatioView/AspectRatioView";
10
+ import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
11
+ import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
12
+ import { TrackingPage } from "../../../tracking/tracking";
13
+ import { Body } from "../../components/layouts/body/Body";
14
+ import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
15
+ import { I18nMessages } from "../../i18n/i18n";
16
+ import { Routes } from "../../routing/routes";
17
+ import { useBasePath } from "../../routing/useBasePath";
18
+ import { HEADER_HEIGHT } from "../navigation/components/header/Header.style";
19
+ import { style } from "./NotFound.style";
20
+ const NotFound = ({ customerId, country }) => {
21
+ const descriptionText = useI18nMessage({ id: I18nMessages.NOT_FOUND_DESCRIPTION });
22
+ const buttonText = useI18nMessage({ id: I18nMessages.NOT_FOUND_BUTTON });
23
+ const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
24
+ usePageView({
25
+ page: TrackingPage.NOT_FOUND,
26
+ country,
27
+ checkoutId: checkout?.id,
28
+ });
29
+ const navigate = useNavigate();
30
+ const basePath = useBasePath();
31
+ const handleOnPress = useCallback(() => navigate(`${basePath}/${Routes.HOME}`), [basePath, navigate]);
32
+ const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
33
+ const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutStatus);
34
+ if (!dependenciesLoaded)
35
+ return React.createElement(Spinner, null);
36
+ return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { scrollView: style.container } },
37
+ React.createElement(Body, { style: { column: style.bodyColumn } },
38
+ React.createElement(AspectRatioView, { aspectRatio: 1.25 },
39
+ React.createElement(Image, { resizeMode: "contain", source: require("../../../../public/images/not-found.png"), style: style.image, testID: "not-found-image" })),
40
+ React.createElement(Text, { level: 1, style: style.description, body: true }, descriptionText),
41
+ React.createElement(Button, { onPress: handleOnPress }, buttonText))));
42
+ };
43
+ export { NotFound };
@@ -0,0 +1,16 @@
1
+ declare const style: {
2
+ bodyColumn: {
3
+ paddingHorizontal: number;
4
+ };
5
+ container: {
6
+ flex: number;
7
+ };
8
+ description: {
9
+ marginBottom: number;
10
+ textAlign: "center";
11
+ };
12
+ image: {
13
+ flex: number;
14
+ };
15
+ };
16
+ export { style };
@@ -0,0 +1,19 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../theme/theme";
3
+ const { spaceXL } = theme();
4
+ const style = StyleSheet.create({
5
+ bodyColumn: {
6
+ paddingHorizontal: spaceXL,
7
+ },
8
+ container: {
9
+ flex: 1,
10
+ },
11
+ description: {
12
+ marginBottom: spaceXL,
13
+ textAlign: "center",
14
+ },
15
+ image: {
16
+ flex: 1,
17
+ },
18
+ });
19
+ export { style };
@@ -5,10 +5,12 @@ import React, { useCallback, useMemo, useState } from "react";
5
5
  import { Platform, View } from "react-native";
6
6
  import { generatePath, useNavigate } from "react-router-native";
7
7
  import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
8
+ import { usePageView } from "../../../../shared/tracking/infrastructure/usePageView";
8
9
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
9
10
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
10
11
  import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
11
12
  import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
13
+ import { TrackingPage } from "../../../tracking/tracking";
12
14
  import { Body } from "../../components/layouts/body/Body";
13
15
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
14
16
  import { I18nMessages } from "../../i18n/i18n";
@@ -29,6 +31,11 @@ const Summary = ({ customerId, country }) => {
29
31
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
30
32
  const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
31
33
  const [fiveItemsDiscount = 0, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({ customerId });
34
+ usePageView({
35
+ page: TrackingPage.SUMMARY,
36
+ country,
37
+ checkoutId: checkout?.id,
38
+ });
32
39
  const navigate = useNavigate();
33
40
  const basePath = useBasePath();
34
41
  const [pricingCollapsed, setPricingCollapsed] = useState(true);
@@ -43,7 +50,7 @@ const Summary = ({ customerId, country }) => {
43
50
  dependenciesLoadedStatuses.includes(fiveItemsDiscountStatus);
44
51
  if (!dependenciesLoaded)
45
52
  return React.createElement(Spinner, null);
46
- return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container }, footer: pricing && (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })) },
53
+ return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, footer: pricing && (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })) },
47
54
  React.createElement(Body, { style: { row: { paddingBottom: pricingHeight || spaceXL } } },
48
55
  fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
49
56
  React.createElement(View, { style: style.content },