@lookiero/checkout 0.5.7 → 0.6.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 (84) hide show
  1. package/README.md +0 -9
  2. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +13 -0
  3. package/dist/domain/checkout/command/markCheckoutAsPaid.js +4 -0
  4. package/dist/domain/checkout/model/checkoutPaid.d.ts +13 -0
  5. package/dist/domain/checkout/model/checkoutPaid.js +4 -0
  6. package/dist/index.d.ts +2 -2
  7. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +5 -0
  8. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +13 -0
  9. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +13 -0
  10. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +16 -0
  11. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +13 -0
  12. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +14 -0
  13. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +12 -0
  14. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +9 -0
  15. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +10 -0
  16. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +12 -0
  17. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +12 -0
  18. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +9 -0
  19. package/dist/infrastructure/ui/Root.d.ts +4 -2
  20. package/dist/infrastructure/ui/Root.js +16 -6
  21. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +1 -2
  22. package/dist/infrastructure/ui/i18n/i18n.d.ts +1 -3
  23. package/dist/infrastructure/ui/i18n/i18n.js +0 -2
  24. package/dist/infrastructure/ui/routing/Routing.js +4 -12
  25. package/dist/infrastructure/ui/views/App.style.d.ts +4 -0
  26. package/dist/infrastructure/ui/views/App.style.js +16 -0
  27. package/dist/infrastructure/ui/views/checkout/Checkout.js +5 -12
  28. package/dist/infrastructure/ui/views/checkout/Checkout.style.d.ts +3 -0
  29. package/dist/infrastructure/ui/views/checkout/Checkout.style.js +3 -0
  30. package/dist/infrastructure/ui/views/feedback/Feedback.d.ts +0 -2
  31. package/dist/infrastructure/ui/views/feedback/Feedback.js +2 -9
  32. package/dist/infrastructure/ui/views/feedback/Feedback.style.d.ts +3 -0
  33. package/dist/infrastructure/ui/views/feedback/Feedback.style.js +3 -0
  34. package/dist/infrastructure/ui/views/header/Header.d.ts +15 -0
  35. package/dist/infrastructure/ui/views/header/Header.js +90 -0
  36. package/dist/infrastructure/ui/views/header/Header.style.d.ts +35 -0
  37. package/dist/infrastructure/ui/views/header/Header.style.js +38 -0
  38. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +7 -0
  39. package/dist/infrastructure/ui/views/header/components/Logo.js +11 -0
  40. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +7 -0
  41. package/dist/infrastructure/ui/{components/templates/SafeAreaScrollView.style.ts.js → views/header/components/Logo.style.js} +3 -2
  42. package/dist/infrastructure/ui/views/intro/Intro.js +1 -1
  43. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +3 -0
  44. package/dist/infrastructure/ui/views/intro/Intro.style.js +3 -0
  45. package/dist/infrastructure/ui/views/item/Item.js +1 -9
  46. package/dist/infrastructure/ui/views/item/Item.style.d.ts +3 -0
  47. package/dist/infrastructure/ui/views/item/Item.style.js +3 -0
  48. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -1
  49. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +1 -6
  50. package/dist/infrastructure/ui/views/summary/Summary.js +1 -8
  51. package/dist/infrastructure/ui/views/summary/Summary.style.d.ts +3 -0
  52. package/dist/infrastructure/ui/views/summary/Summary.style.js +3 -0
  53. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +10 -0
  54. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +1 -0
  55. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +25 -0
  56. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +8 -0
  57. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +25 -0
  58. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +8 -0
  59. package/dist/shared/logging/SentryLogger.d.ts +15 -0
  60. package/dist/shared/logging/SentryLogger.js +39 -0
  61. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +1 -0
  62. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +9 -0
  63. package/dist/shared/ui/components/atoms/field/Field.js +5 -13
  64. package/dist/shared/ui/components/atoms/field/Field.style.js +2 -2
  65. package/dist/shared/ui/components/molecules/inputField/InputField.js +2 -2
  66. package/dist/shared/ui/components/molecules/inputField/InputField.style.d.ts +1 -0
  67. package/dist/shared/ui/components/molecules/inputField/InputField.style.js +1 -0
  68. package/package.json +9 -13
  69. package/dist/infrastructure/tracking/tracking.d.ts +0 -9
  70. package/dist/infrastructure/tracking/tracking.js +0 -10
  71. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +0 -6
  72. package/dist/infrastructure/ui/views/notFound/NotFound.d.ts +0 -8
  73. package/dist/infrastructure/ui/views/notFound/NotFound.js +0 -43
  74. package/dist/infrastructure/ui/views/notFound/NotFound.style.d.ts +0 -16
  75. package/dist/infrastructure/ui/views/notFound/NotFound.style.js +0 -19
  76. package/dist/public/images/not-found.png +0 -0
  77. package/dist/shared/tracking/infrastructure/useEmitUserEvent.d.ts +0 -6
  78. package/dist/shared/tracking/infrastructure/useEmitUserEvent.js +0 -7
  79. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  80. package/dist/shared/tracking/infrastructure/usePageView.js +0 -21
  81. package/dist/shared/tracking/tracking.d.ts +0 -19
  82. package/dist/shared/tracking/tracking.js +0 -9
  83. package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +0 -12
  84. package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +0 -16
package/README.md CHANGED
@@ -26,15 +26,6 @@ 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
- },
38
29
  "dependencies": {
39
30
  (...)
40
31
  "@expo/dev-server": "0.1.120",
@@ -0,0 +1,13 @@
1
+ import { Command } from "@lookiero/messaging";
2
+ declare const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
+ interface MarkCheckoutAsPaidPayload {
4
+ readonly aggregateId: string;
5
+ }
6
+ interface MarkCheckoutAsPaid extends Command<typeof MARK_CHECKOUT_AS_PAID>, MarkCheckoutAsPaidPayload {
7
+ }
8
+ interface MarkCheckoutAsPaidFunction {
9
+ (payload: MarkCheckoutAsPaidPayload): MarkCheckoutAsPaid;
10
+ }
11
+ declare const markCheckoutAsPaid: MarkCheckoutAsPaidFunction;
12
+ export type { MarkCheckoutAsPaid };
13
+ export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -0,0 +1,4 @@
1
+ import { command } from "@lookiero/messaging";
2
+ const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
+ const markCheckoutAsPaid = ({ aggregateId }) => command({ aggregateId, name: MARK_CHECKOUT_AS_PAID });
4
+ export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -0,0 +1,13 @@
1
+ import { DomainEvent } from "@lookiero/messaging";
2
+ declare const CHECKOUT_PAID = "checkout_paid";
3
+ interface CheckoutPaidPayload {
4
+ readonly aggregateId: string;
5
+ }
6
+ interface CheckoutPaid extends DomainEvent<typeof CHECKOUT_PAID>, CheckoutPaidPayload {
7
+ }
8
+ interface CheckoutPaidFunction {
9
+ (payload: CheckoutPaidPayload): CheckoutPaid;
10
+ }
11
+ declare const checkoutPaid: CheckoutPaidFunction;
12
+ export type { CheckoutPaid };
13
+ export { CHECKOUT_PAID, checkoutPaid };
@@ -0,0 +1,4 @@
1
+ import { domainEvent } from "@lookiero/messaging";
2
+ const CHECKOUT_PAID = "checkout_paid";
3
+ const checkoutPaid = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_PAID });
4
+ export { CHECKOUT_PAID, checkoutPaid };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { EndpointFunction } from "@lookiero/i18n";
2
- import { FC } from "react";
2
+ import { ComponentType } from "react";
3
3
  import { RootProps } from "./infrastructure/ui/Root";
4
4
  import { IsCheckoutAccessibleByCustomerIdProjection } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
5
5
  interface IsCheckoutAccessibleFunctionArgs {
@@ -14,7 +14,7 @@ interface BootstrapFunctionArgs {
14
14
  readonly translations: EndpointFunction;
15
15
  }
16
16
  interface BootstrapFunctionReturn {
17
- readonly Root: FC<RootProps>;
17
+ readonly Root: ComponentType<RootProps>;
18
18
  readonly isCheckoutAccessible: IsCheckoutAccessibleFunction;
19
19
  }
20
20
  interface BootstrapFunction {
@@ -0,0 +1,5 @@
1
+ import { HttpCheckoutsSaveFunction } from "./httpCheckouts";
2
+ interface HttpCheckoutsMarkAsPaidFunction extends HttpCheckoutsSaveFunction {
3
+ }
4
+ declare const httpCheckoutsMarkAsPaid: HttpCheckoutsMarkAsPaidFunction;
5
+ export { httpCheckoutsMarkAsPaid };
@@ -0,0 +1,13 @@
1
+ import { CHECKOUT_PAID } from "../../../../domain/checkout/model/checkoutPaid";
2
+ const isCheckoutPaid = (event) => event.name === CHECKOUT_PAID;
3
+ const httpCheckoutsMarkAsPaid = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
4
+ const checkoutPaid = domainEvents.find(isCheckoutPaid);
5
+ if (!checkoutPaid) {
6
+ return;
7
+ }
8
+ await httpPost({
9
+ endpoint: "/mark-checkout-as-paid",
10
+ body: { checkoutId: aggregateId },
11
+ });
12
+ };
13
+ export { httpCheckoutsMarkAsPaid };
@@ -0,0 +1,13 @@
1
+ import { CommandStatus } from "@lookiero/messaging-react";
2
+ interface MarkAsPaidFunction {
3
+ (): Promise<void>;
4
+ }
5
+ type UseMarkCheckoutAsPaid = [markAsPaid: MarkAsPaidFunction, status: CommandStatus];
6
+ interface UseMarkCheckoutAsPaidFunctionArgs {
7
+ readonly checkoutId?: string;
8
+ }
9
+ interface UseMarkCheckoutAsPaidFunction {
10
+ (args: UseMarkCheckoutAsPaidFunctionArgs): UseMarkCheckoutAsPaid;
11
+ }
12
+ declare const useMarkCheckoutAsPaid: UseMarkCheckoutAsPaidFunction;
13
+ export { useMarkCheckoutAsPaid };
@@ -0,0 +1,16 @@
1
+ import { useCommand } from "@lookiero/messaging-react";
2
+ import { useCallback } from "react";
3
+ import invariant from "tiny-invariant";
4
+ import { markCheckoutAsPaid } from "../../../../domain/checkout/command/markCheckoutAsPaid";
5
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
+ const useMarkCheckoutAsPaid = ({ checkoutId }) => {
7
+ const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
+ const markAsPaid = useCallback(() => {
9
+ invariant(checkoutId, "CheckoutId must be defined in order to mark the checkout as paid");
10
+ return commandBus(markCheckoutAsPaid({
11
+ aggregateId: checkoutId,
12
+ }));
13
+ }, [checkoutId, commandBus]);
14
+ return [markAsPaid, status];
15
+ };
16
+ export { useMarkCheckoutAsPaid };
@@ -0,0 +1,13 @@
1
+ import { CommandStatus } from "@lookiero/messaging-react";
2
+ interface BookFunction {
3
+ (): Promise<void>;
4
+ }
5
+ type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
6
+ interface UseBookCheckouBookingForCheckoutItemFunctionArgs {
7
+ readonly checkoutItemId: string;
8
+ }
9
+ interface UseBookCheckouBookingForCheckoutItemFunction {
10
+ (args: UseBookCheckouBookingForCheckoutItemFunctionArgs): UseBookCheckouBookingForCheckoutItem;
11
+ }
12
+ declare const useBookCheckouBookingForCheckoutItem: UseBookCheckouBookingForCheckoutItemFunction;
13
+ export { useBookCheckouBookingForCheckoutItem };
@@ -0,0 +1,14 @@
1
+ import { useCommand } from "@lookiero/messaging-react";
2
+ import { useCallback } from "react";
3
+ import { v4 as uuid } from "uuid";
4
+ import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
5
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
+ const useBookCheckouBookingForCheckoutItem = ({ checkoutItemId }) => {
7
+ const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
+ const book = useCallback(() => commandBus(bookCheckoutBookingForCheckoutItem({
9
+ aggregateId: uuid(),
10
+ checkoutItemId,
11
+ })), [checkoutItemId, commandBus]);
12
+ return [book, status];
13
+ };
14
+ export { useBookCheckouBookingForCheckoutItem };
@@ -0,0 +1,12 @@
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 };
@@ -0,0 +1,9 @@
1
+ const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
2
+ const response = await httpPost({
3
+ endpoint: "/view-booked-size-change-product-variants-for-checkout-item",
4
+ body: { checkoutItemId },
5
+ signal,
6
+ });
7
+ return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
+ };
9
+ export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,12 @@
1
+ import { useQuery } from "@lookiero/messaging-react";
2
+ import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
+ import { viewBookedSizeChangeProductsVariantsForCheckoutItem } from "../../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
4
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
+ const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
6
+ const useViewBookedSizeChangeProductsVariantsForCheckoutItem = ({ checkoutItemId }) => useQuery({
7
+ query: viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId }),
8
+ contextId: MESSAGING_CONTEXT_ID,
9
+ invalidation: isCheckoutBookingBooked,
10
+ options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
11
+ });
12
+ export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
@@ -0,0 +1,12 @@
1
+ import { CheckoutFeedbackByCheckoutIdView } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId";
2
+ import { HttpPostFunction } from "../../delivery/http/httpClient";
3
+ interface HttpCheckoutFeebackByCheckoutIdView extends CheckoutFeedbackByCheckoutIdView {
4
+ }
5
+ interface HttpCheckoutFeebackByCheckoutIdViewFunctionArgs {
6
+ readonly httpPost: HttpPostFunction;
7
+ }
8
+ interface HttpCheckoutFeebackByCheckoutIdViewFunction {
9
+ (args: HttpCheckoutFeebackByCheckoutIdViewFunctionArgs): HttpCheckoutFeebackByCheckoutIdView;
10
+ }
11
+ declare const httpCheckoutFeebackByCheckoutIdView: HttpCheckoutFeebackByCheckoutIdViewFunction;
12
+ export { httpCheckoutFeebackByCheckoutIdView };
@@ -0,0 +1,9 @@
1
+ const httpCheckoutFeebackByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => {
2
+ const response = await httpPost({
3
+ endpoint: "/view-checkout-feedback-by-checkout-id",
4
+ body: { checkoutId },
5
+ signal,
6
+ });
7
+ return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
+ };
9
+ export { httpCheckoutFeebackByCheckoutIdView };
@@ -1,16 +1,18 @@
1
1
  import { I18n } from "@lookiero/i18n-react";
2
2
  import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
3
- import { FC } from "react";
3
+ import { ComponentType } from "react";
4
4
  import { Customer } from "../../projection/shared/customer";
5
+ import { SentryLoggerFunctionArgs } from "../../shared/logging/SentryLogger";
5
6
  import { Menu, TabBar } from "./views/navigation/Navigation";
6
7
  interface RootFunctionArgs {
7
8
  readonly Messaging: MessagingRoot;
8
9
  readonly I18n: I18n;
9
10
  readonly development?: boolean;
11
+ readonly sentry?: SentryLoggerFunctionArgs;
10
12
  readonly getAuthToken: () => Promise<string>;
11
13
  }
12
14
  interface RootFunction {
13
- (args: RootFunctionArgs): FC<RootProps>;
15
+ (args: RootFunctionArgs): ComponentType<RootProps>;
14
16
  }
15
17
  interface RootProps {
16
18
  readonly basePath: string;
@@ -1,11 +1,21 @@
1
1
  import React, { useCallback } from "react";
2
2
  import { Platform } from "react-native";
3
+ import { sentryLogger } from "../../shared/logging/SentryLogger";
3
4
  import { Routing } from "./routing/Routing";
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 })));
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;
10
20
  };
11
21
  export { root };
@@ -2,11 +2,10 @@ 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";
6
5
  const { spaceXXXL } = theme();
7
6
  const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
8
7
  const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
9
- return (React.createElement(SafeAreaView, { edges: edges, style: [style.safeAreaView, customStyle?.safeAreaView] },
8
+ return (React.createElement(SafeAreaView, { edges: edges, style: customStyle?.safeAreaView },
10
9
  React.createElement(ScrollView, { contentContainerStyle: [
11
10
  {
12
11
  paddingTop: safeAreaInsetTop + scrollerPaddingTop,
@@ -58,8 +58,6 @@ 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",
62
- NOT_FOUND_DESCRIPTION = "not_found.description",
63
- NOT_FOUND_BUTTON = "not_found.button"
61
+ CHECKOUT_TOAST_BOOKING_EXPIRED = "checkout.toast_booking_expired"
64
62
  }
65
63
  export { I18nMessages, COLOR_I18N_PREFIX };
@@ -60,7 +60,5 @@ 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";
65
63
  })(I18nMessages || (I18nMessages = {}));
66
64
  export { I18nMessages, COLOR_I18N_PREFIX };
@@ -1,4 +1,3 @@
1
- import { PaymentsQueryProvider } from "@lookiero/payments-front";
2
1
  import React, { lazy, Suspense } from "react";
3
2
  import { Navigate, Outlet, useRoutes } from "react-router-native";
4
3
  import { Spinner } from "../../../shared/ui/components/atoms/spinner/Spinner";
@@ -13,7 +12,6 @@ const Item = lazy(() => import("../views/item/Item").then((module) => ({ default
13
12
  const Summary = lazy(() => import("../views/summary/Summary").then((module) => ({ default: module.Summary })));
14
13
  const Checkout = lazy(() => import("../views/checkout/Checkout").then((module) => ({ default: module.Checkout })));
15
14
  const Feedback = lazy(() => import("../views/feedback/Feedback").then((module) => ({ default: module.Feedback })));
16
- const NotFound = lazy(() => import("../views/notFound/NotFound").then((module) => ({ default: module.NotFound })));
17
15
  const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthToken, onI18nError, onNotAccessible, useRedirect, }) => {
18
16
  const routes = useRoutes([
19
17
  {
@@ -48,9 +46,8 @@ const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthT
48
46
  {
49
47
  path: Routes.CHECKOUT,
50
48
  element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
51
- React.createElement(PaymentsQueryProvider, null,
52
- React.createElement(Checkout, { country: customer?.country, customerId: customer?.customerId, useRedirect: useRedirect },
53
- React.createElement(Outlet, null))))),
49
+ React.createElement(Checkout, { country: customer?.country, customerId: customer?.customerId, useRedirect: useRedirect },
50
+ React.createElement(Outlet, null)))),
54
51
  children: [
55
52
  {
56
53
  path: Routes.CHECKOUT_PAYMENT,
@@ -61,16 +58,11 @@ const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthT
61
58
  {
62
59
  path: Routes.FEEDBACK,
63
60
  element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
64
- React.createElement(Feedback, { country: customer?.country, customerId: customer?.customerId }))),
65
- },
66
- {
67
- path: Routes.NOT_FOUND,
68
- element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
69
- React.createElement(NotFound, { country: customer?.country, customerId: customer?.customerId }))),
61
+ React.createElement(Feedback, { customerId: customer?.customerId }))),
70
62
  },
71
63
  {
72
64
  path: "*",
73
- element: React.createElement(Navigate, { to: `${Routes.NOT_FOUND}`, replace: true }),
65
+ element: React.createElement(Navigate, { to: `${Routes.HOME}`, replace: true }),
74
66
  },
75
67
  ],
76
68
  },
@@ -0,0 +1,4 @@
1
+ declare const style: {
2
+ header: {};
3
+ };
4
+ export { style };
@@ -0,0 +1,16 @@
1
+ import { Platform, StyleSheet } from "react-native";
2
+ const style = StyleSheet.create({
3
+ header: {
4
+ ...Platform.select({
5
+ web: {
6
+ position: "fixed",
7
+ zIndex: 1,
8
+ },
9
+ native: {
10
+ position: "absolute",
11
+ zIndex: 1,
12
+ },
13
+ }),
14
+ },
15
+ });
16
+ export { style };
@@ -6,11 +6,9 @@ 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";
10
9
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
11
10
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
12
11
  import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
13
- import { TrackingPage } from "../../../tracking/tracking";
14
12
  import { Body } from "../../components/layouts/body/Body";
15
13
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
16
14
  import { I18nMessages } from "../../i18n/i18n";
@@ -26,11 +24,6 @@ const Checkout = ({ children, customerId, country, useRedirect }) => {
26
24
  const paymentInstrumentSelectRef = useRef(null);
27
25
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
28
26
  const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
29
- usePageView({
30
- page: TrackingPage.CHECKOUT,
31
- country,
32
- checkoutId: checkout?.id,
33
- });
34
27
  const navigate = useNavigate();
35
28
  const basePath = useBasePath();
36
29
  const { returnUrl } = useRedirect();
@@ -45,18 +38,18 @@ const Checkout = ({ children, customerId, country, useRedirect }) => {
45
38
  if (!dependenciesLoaded)
46
39
  return React.createElement(Spinner, null);
47
40
  return (React.createElement(React.Fragment, null,
48
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
41
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container } },
49
42
  React.createElement(Body, { style: { column: style.bodyColumn } },
50
43
  hasReplacedCheckoutItem && (React.createElement(View, { style: style.deliveryBannerContainer },
51
44
  React.createElement(DeliveryBanner, null))),
52
45
  React.createElement(PaymentInstrumentSelect, { ref: paymentInstrumentSelectRef, beforeRedirect: returnUrl ? () => Promise.resolve(returnUrl) : undefined, hasError: false, hidePaymentMethods: [PaymentMethod.GOOGLE_PAY], section: Section.BOX_CHECKOUT }),
53
46
  React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
54
47
  checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, style: style.checkoutItemKept, testID: "checkout-items-kept" },
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 })))),
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 })))),
58
49
  pricing && (React.createElement(View, { style: style.pricingContainer },
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 }))))),
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 }))))),
60
53
  children));
61
54
  };
62
55
  export { Checkout };
@@ -5,6 +5,9 @@ declare const style: {
5
5
  checkoutItemKept: {
6
6
  paddingVertical: number;
7
7
  };
8
+ container: {
9
+ flex: number;
10
+ };
8
11
  deliveryBannerContainer: {
9
12
  marginBottom: number;
10
13
  };
@@ -8,6 +8,9 @@ const style = StyleSheet.create({
8
8
  checkoutItemKept: {
9
9
  paddingVertical: spaceM,
10
10
  },
11
+ container: {
12
+ flex: 1,
13
+ },
11
14
  deliveryBannerContainer: {
12
15
  marginBottom: spaceXXL,
13
16
  },
@@ -1,8 +1,6 @@
1
1
  import { FC } from "react";
2
- import { Country } from "../../../../projection/shared/country";
3
2
  interface FeedbackProps {
4
3
  readonly customerId: string;
5
- readonly country: Country;
6
4
  }
7
5
  declare const Feedback: FC<FeedbackProps>;
8
6
  export { Feedback };
@@ -1,19 +1,17 @@
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";
5
4
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
6
5
  import { useGiveCheckoutFeedback } from "../../../domain/checkoutFeedback/react/useGiveCheckoutFeedback";
7
6
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
8
7
  import { useListCheckoutQuestionsByCheckoutId } from "../../../projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId";
9
- import { TrackingPage } from "../../../tracking/tracking";
10
8
  import { Body } from "../../components/layouts/body/Body";
11
9
  import { CheckoutQuestionFeedbackProvider } from "../../components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionFeedback";
12
10
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
13
11
  import { HEADER_HEIGHT } from "../navigation/components/header/Header.style";
14
12
  import { style } from "./Feedback.style";
15
13
  import { CheckoutQuestionsForm } from "./components/checkoutQuestionsForm/CheckoutQuestionsForm";
16
- const Feedback = ({ customerId, country }) => {
14
+ const Feedback = ({ customerId }) => {
17
15
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
18
16
  const [checkoutQuestions, checkoutQuestionsStatus] = useListCheckoutQuestionsByCheckoutId({
19
17
  checkoutId: checkout?.id,
@@ -27,17 +25,12 @@ const Feedback = ({ customerId, country }) => {
27
25
  }
28
26
  catch (e) { }
29
27
  }, [giveCheckoutFeedback]);
30
- usePageView({
31
- page: TrackingPage.FEEDBACK,
32
- country,
33
- checkoutId: checkout?.id,
34
- });
35
28
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
36
29
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutStatus) && dependenciesLoadedStatuses.includes(checkoutQuestionsStatus);
37
30
  if (!dependenciesLoaded)
38
31
  return React.createElement(Spinner, null);
39
32
  return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {} },
40
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
33
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container } },
41
34
  React.createElement(Body, { style: { column: style.bodyColumn } },
42
35
  React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
43
36
  };
@@ -2,5 +2,8 @@ declare const style: {
2
2
  bodyColumn: {
3
3
  paddingHorizontal: number;
4
4
  };
5
+ container: {
6
+ flex: number;
7
+ };
5
8
  };
6
9
  export { style };
@@ -5,5 +5,8 @@ const style = StyleSheet.create({
5
5
  bodyColumn: {
6
6
  paddingHorizontal: spaceXL,
7
7
  },
8
+ container: {
9
+ flex: 1,
10
+ },
8
11
  });
9
12
  export { style };
@@ -0,0 +1,15 @@
1
+ import { FC } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ interface MenuProps {
4
+ readonly isVisible: boolean;
5
+ readonly onClose: () => void;
6
+ }
7
+ type Menu = FC<MenuProps>;
8
+ interface HeaderProps {
9
+ readonly customerId: string;
10
+ readonly menu: Menu;
11
+ readonly style?: StyleProp<ViewStyle>;
12
+ }
13
+ declare const Header: FC<HeaderProps>;
14
+ export type { Menu };
15
+ export { Header };