@lookiero/checkout 0.6.0-beta.8 → 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.
- package/README.md +9 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +2 -2
- package/dist/infrastructure/tracking/tracking.d.ts +9 -0
- package/dist/infrastructure/tracking/tracking.js +10 -0
- package/dist/infrastructure/ui/Root.d.ts +2 -4
- package/dist/infrastructure/ui/Root.js +6 -16
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +2 -1
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +6 -0
- package/dist/infrastructure/ui/{views/header/components/Logo.style.js → components/templates/SafeAreaScrollView.style.ts.js} +2 -3
- package/dist/infrastructure/ui/i18n/i18n.d.ts +3 -1
- package/dist/infrastructure/ui/i18n/i18n.js +2 -0
- package/dist/infrastructure/ui/routing/Routing.js +8 -2
- package/dist/infrastructure/ui/views/App.js +4 -10
- package/dist/infrastructure/ui/views/checkout/Checkout.js +12 -5
- package/dist/infrastructure/ui/views/checkout/Checkout.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/checkout/Checkout.style.js +0 -3
- package/dist/infrastructure/ui/views/feedback/Feedback.d.ts +2 -0
- package/dist/infrastructure/ui/views/feedback/Feedback.js +9 -2
- package/dist/infrastructure/ui/views/feedback/Feedback.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/feedback/Feedback.style.js +0 -3
- package/dist/infrastructure/ui/views/intro/Intro.js +1 -1
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -3
- package/dist/infrastructure/ui/views/item/Item.js +9 -1
- package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/item/Item.style.js +0 -3
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +1 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +6 -1
- package/dist/infrastructure/ui/views/notFound/NotFound.d.ts +8 -0
- package/dist/infrastructure/ui/views/notFound/NotFound.js +43 -0
- package/dist/infrastructure/ui/views/notFound/NotFound.style.d.ts +16 -0
- package/dist/infrastructure/ui/views/notFound/NotFound.style.js +19 -0
- package/dist/infrastructure/ui/views/summary/Summary.js +8 -1
- package/dist/infrastructure/ui/views/summary/Summary.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/summary/Summary.style.js +0 -3
- package/dist/public/images/not-found.png +0 -0
- package/dist/shared/tracking/infrastructure/useEmitUserEvent.d.ts +6 -0
- package/dist/shared/tracking/infrastructure/useEmitUserEvent.js +7 -0
- package/dist/shared/tracking/infrastructure/usePageView.d.ts +13 -0
- package/dist/shared/tracking/infrastructure/usePageView.js +21 -0
- package/dist/shared/tracking/tracking.d.ts +19 -0
- package/dist/shared/tracking/tracking.js +9 -0
- package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +12 -0
- package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
- package/dist/shared/ui/components/atoms/field/Field.js +13 -5
- package/dist/shared/ui/components/atoms/field/Field.style.js +2 -2
- package/dist/shared/ui/components/molecules/inputField/InputField.js +2 -2
- package/dist/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -1
- package/dist/shared/ui/components/molecules/inputField/InputField.style.js +0 -1
- package/package.json +13 -10
- package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +0 -13
- package/dist/domain/checkout/command/markCheckoutAsPaid.js +0 -4
- package/dist/domain/checkout/model/checkoutPaid.d.ts +0 -13
- package/dist/domain/checkout/model/checkoutPaid.js +0 -4
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +0 -5
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +0 -13
- package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +0 -13
- package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +0 -16
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -13
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +0 -14
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +0 -9
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +0 -12
- package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +0 -12
- package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +0 -9
- package/dist/infrastructure/ui/views/App.style.d.ts +0 -4
- package/dist/infrastructure/ui/views/App.style.js +0 -16
- package/dist/infrastructure/ui/views/header/Header.d.ts +0 -15
- package/dist/infrastructure/ui/views/header/Header.js +0 -90
- package/dist/infrastructure/ui/views/header/Header.style.d.ts +0 -35
- package/dist/infrastructure/ui/views/header/Header.style.js +0 -38
- package/dist/infrastructure/ui/views/header/components/Logo.d.ts +0 -7
- package/dist/infrastructure/ui/views/header/components/Logo.js +0 -11
- package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +0 -7
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -10
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +0 -1
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
- package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +0 -25
- package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +0 -8
- package/dist/shared/logging/SentryDependencies.d.ts +0 -4
- package/dist/shared/logging/SentryDependencies.js +0 -4
- package/dist/shared/logging/SentryDependencies.native.d.ts +0 -2
- package/dist/shared/logging/SentryDependencies.native.js +0 -2
- package/dist/shared/logging/SentryLogger.d.ts +0 -14
- package/dist/shared/logging/SentryLogger.js +0 -50
- package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
- 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 {
|
|
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:
|
|
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
|
|
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
|
|
12
|
+
const Root = root({ Messaging, I18n, getAuthToken });
|
|
13
13
|
const isCheckoutAccessible = ({ customerId }) => queryBus(viewIsCheckoutAccessibleByCustomerId({ customerId }));
|
|
14
14
|
return {
|
|
15
15
|
Root,
|
|
@@ -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 {
|
|
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):
|
|
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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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,
|
|
@@ -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.
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
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,
|
|
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 };
|
|
@@ -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
|
|
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
|
};
|
|
@@ -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
|
|
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 },
|
|
@@ -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,
|
|
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,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,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,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,
|
|
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 },
|