@lookiero/checkout 9.12.0-beta.0 → 9.13.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/dist/index.js +2 -1
- package/dist/src/ExpoRoot.js +5 -4
- package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +2 -1
- package/dist/src/infrastructure/ui/components/atoms/price/Price.js +3 -0
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +3 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +3 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +3 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +5 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +6 -6
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +3 -2
- package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +2 -2
- package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js +2 -2
- package/dist/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +2 -2
- package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -1
- package/dist/src/infrastructure/ui/i18n/i18n.js +2 -1
- package/dist/src/infrastructure/ui/test/render.js +4 -2
- package/dist/src/infrastructure/ui/views/App.js +2 -1
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +3 -3
- package/dist/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js +2 -2
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +11 -5
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -4
- package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -4
- package/dist/src/infrastructure/ui/views/return/components/price/Price.js +3 -0
- package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +3 -3
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +4 -4
- package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
- package/dist/src/infrastructure/ui/views/summary/Summary.js +4 -4
- package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +3 -2
- package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +8 -6
- package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +5 -5
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/index.ts +2 -1
- package/package.json +5 -6
- package/src/ExpoRoot.tsx +5 -4
- package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx +3 -2
- package/src/infrastructure/ui/components/atoms/price/Price.tsx +3 -0
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +3 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +3 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +3 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +3 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +6 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +7 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +3 -2
- package/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.tsx +2 -2
- package/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.tsx +2 -2
- package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.tsx +2 -2
- package/src/infrastructure/ui/i18n/i18n.ts +3 -1
- package/src/infrastructure/ui/test/render.tsx +6 -3
- package/src/infrastructure/ui/views/App.tsx +2 -1
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +3 -3
- package/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.tsx +2 -2
- package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +2 -2
- package/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.tsx +3 -3
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +11 -5
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +159 -87
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +4 -4
- package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +242 -126
- package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.tsx +3 -3
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -2
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -4
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +74 -40
- package/src/infrastructure/ui/views/return/components/price/Price.tsx +3 -0
- package/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.tsx +3 -3
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +4 -4
- package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.tsx +4 -4
- package/src/infrastructure/ui/views/summary/Summary.tsx +4 -4
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +3 -2
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +152 -80
- package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +8 -6
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +5 -5
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
|
-
import { useI18nMessage,
|
|
5
|
+
import { useI18nMessage, useI18n } from "@lookiero/i18n-react";
|
|
6
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
-
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
7
|
+
import { DOMAIN, I18nMessages } from "../../../../../i18n/i18n";
|
|
8
8
|
import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
|
|
9
9
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
10
10
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
11
11
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
12
12
|
|
|
13
13
|
const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT> = ({ returnQuestion }) => {
|
|
14
|
-
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
15
|
-
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
14
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: returnQuestion.translationKey });
|
|
15
|
+
const unansweredText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
16
16
|
|
|
17
17
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
20
20
|
const translate = useCallback(
|
|
21
|
-
(returnQuestionName: string) =>
|
|
22
|
-
[
|
|
21
|
+
(returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
22
|
+
[formatMessage],
|
|
23
23
|
);
|
|
24
24
|
const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(
|
|
25
25
|
" / ",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React, { useCallback, useMemo } from "react";
|
|
3
3
|
import { View } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
4
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
5
5
|
import { InputField, TextInput } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
8
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
9
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
9
10
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
@@ -13,7 +14,7 @@ const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA
|
|
|
13
14
|
returnQuestionParent,
|
|
14
15
|
testID,
|
|
15
16
|
}) => {
|
|
16
|
-
const { formatMessage } =
|
|
17
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
17
18
|
|
|
18
19
|
const placeholderText = useMemo(
|
|
19
20
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC } from "react";
|
|
2
2
|
import { ButtonIcon, Text } from "@lookiero/aurora";
|
|
3
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
4
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
5
5
|
import { Header } from "../Header";
|
|
6
6
|
import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
|
|
7
7
|
import { style } from "./CheckoutHeader.style";
|
|
@@ -11,7 +11,7 @@ interface CheckoutHeaderProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const CheckoutHeader: FC<CheckoutHeaderProps> = ({ onBack }) => {
|
|
14
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_COMPLETE_CHECKOUT_TITLE });
|
|
14
|
+
const title = useI18nMessage({ domain: DOMAIN, id: I18nMessages.HEADER_COMPLETE_CHECKOUT_TITLE });
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<Header testID="checkout-header">
|
package/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC } from "react";
|
|
2
2
|
import { ButtonIcon, Text } from "@lookiero/aurora";
|
|
3
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
4
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
5
5
|
import { Header } from "../Header";
|
|
6
6
|
import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
|
|
7
7
|
import { style } from "./ItemDetailHeader.style";
|
|
@@ -10,7 +10,7 @@ interface ItemDetailHeaderProps {
|
|
|
10
10
|
readonly onBack: () => void;
|
|
11
11
|
}
|
|
12
12
|
const ItemDetailHeader: FC<ItemDetailHeaderProps> = ({ onBack }) => {
|
|
13
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
13
|
+
const title = useI18nMessage({ domain: DOMAIN, id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<Header testID="item-detail-header">
|
|
@@ -4,7 +4,7 @@ import { generatePath, useNavigate } from "react-router-native";
|
|
|
4
4
|
import { ButtonIcon, Text } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
7
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
8
8
|
import { Routes } from "../../../../routing/routes";
|
|
9
9
|
import { useBasePath } from "../../../../routing/useBasePath";
|
|
10
10
|
import { Header } from "../Header";
|
|
@@ -34,7 +34,7 @@ interface ItemHeaderProps {
|
|
|
34
34
|
readonly onPrevious?: OnPreviousItemFunction;
|
|
35
35
|
}
|
|
36
36
|
const ItemHeader: FC<ItemHeaderProps> = ({ items, item, onNext, onPrevious }) => {
|
|
37
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
37
|
+
const title = useI18nMessage({ domain: DOMAIN, id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
38
38
|
const itemIndex = items.indexOf(item);
|
|
39
39
|
const isFirstItem = itemIndex === 0;
|
|
40
40
|
const isLastItem = itemIndex === items.length - 1;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const DOMAIN = "CheckoutI18n";
|
|
2
|
+
|
|
1
3
|
// TODO: deprecated?
|
|
2
4
|
const COLOR_I18N_PREFIX = "catalog.color.";
|
|
3
5
|
|
|
@@ -58,4 +60,4 @@ enum I18nMessages {
|
|
|
58
60
|
CHECKOUT_TOAST_BOOKING_EXPIRED = "checkout.toast_booking_expired",
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
export { I18nMessages, COLOR_I18N_PREFIX };
|
|
63
|
+
export { DOMAIN, I18nMessages, COLOR_I18N_PREFIX };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { render, RenderAPI } from "@testing-library/react-native";
|
|
2
2
|
import { mock } from "jest-mock-extended";
|
|
3
3
|
import React, { FC, Fragment, ReactElement } from "react";
|
|
4
|
-
import { IntlProvider } from "react-intl";
|
|
5
4
|
import { Aurora } from "@lookiero/aurora";
|
|
5
|
+
import { createI18nProvider } from "@lookiero/i18n-react";
|
|
6
6
|
import { TranslationMessages } from "@lookiero/i18n/domain/translation/model/translationMessages";
|
|
7
7
|
import { Logger, LoggerProvider } from "@lookiero/sty-psp-logging";
|
|
8
|
+
import { DOMAIN } from "../i18n/i18n";
|
|
8
9
|
import { BasePathProvider } from "../routing/useBasePath";
|
|
9
10
|
|
|
11
|
+
const I18nProvider = createI18nProvider({ domain: DOMAIN });
|
|
12
|
+
|
|
10
13
|
interface RenderArgs {
|
|
11
14
|
readonly locale?: string;
|
|
12
15
|
readonly messages?: TranslationMessages;
|
|
@@ -24,13 +27,13 @@ const renderWrapper: RenderWrapperFunction =
|
|
|
24
27
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
25
28
|
({ children }) => (
|
|
26
29
|
<Aurora>
|
|
27
|
-
<
|
|
30
|
+
<I18nProvider locale={locale as string} messages={messages} onError={() => void 0}>
|
|
28
31
|
<LoggerProvider logger={logger}>
|
|
29
32
|
<BasePathProvider basePath="">
|
|
30
33
|
<Wrapper>{children}</Wrapper>
|
|
31
34
|
</BasePathProvider>
|
|
32
35
|
</LoggerProvider>
|
|
33
|
-
</
|
|
36
|
+
</I18nProvider>
|
|
34
37
|
</Aurora>
|
|
35
38
|
);
|
|
36
39
|
|
|
@@ -6,6 +6,7 @@ import { PortalProvider as AuroraPortalProvider } from "@lookiero/aurora";
|
|
|
6
6
|
import { Notifications } from "@lookiero/sty-psp-notifications";
|
|
7
7
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
8
8
|
import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
|
|
9
|
+
import { DOMAIN } from "../i18n/i18n";
|
|
9
10
|
|
|
10
11
|
const { colorBgBase } = theme();
|
|
11
12
|
|
|
@@ -17,7 +18,7 @@ const App: FC<AppProps> = ({ children }) => (
|
|
|
17
18
|
<SafeAreaProvider>
|
|
18
19
|
<PortalProvider rootHostName="Checkout">
|
|
19
20
|
<StatusBar backgroundColor={colorBgBase} barStyle="dark-content" translucent />
|
|
20
|
-
<Notifications contextId={MESSAGING_CONTEXT_ID} portalHostName="Checkout" />
|
|
21
|
+
<Notifications contextId={MESSAGING_CONTEXT_ID} domain={DOMAIN} portalHostName="Checkout" />
|
|
21
22
|
{/*
|
|
22
23
|
We are using the Aurora's PortalProvider at this level for notifications to work properly.
|
|
23
24
|
|
|
@@ -15,7 +15,7 @@ import { useTrackPressContinue } from "../../../tracking/useTrackPressContinue";
|
|
|
15
15
|
import { Body } from "../../components/layouts/body/Body";
|
|
16
16
|
import { CheckoutHeader } from "../../components/templates/header/checkoutHeader/CheckoutHeader";
|
|
17
17
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
18
|
-
import { I18nMessages } from "../../i18n/i18n";
|
|
18
|
+
import { DOMAIN, I18nMessages } from "../../i18n/i18n";
|
|
19
19
|
import { Routes } from "../../routing/routes";
|
|
20
20
|
import { useBasePath } from "../../routing/useBasePath";
|
|
21
21
|
import { ProductVariant } from "../shared/components/productVariant/ProductVariant";
|
|
@@ -34,8 +34,8 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect })
|
|
|
34
34
|
const {
|
|
35
35
|
customer: { customerId, country, segment },
|
|
36
36
|
} = useStaticInfo();
|
|
37
|
-
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
|
|
38
|
-
const submitButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
37
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_TITLE });
|
|
38
|
+
const submitButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
39
39
|
const { screen } = useDevice();
|
|
40
40
|
const [pricingHeight, setPricingHeight] = useState(0);
|
|
41
41
|
const handleOnPricingLayout = useCallback(({ height }: LayoutRectangle) => setPricingHeight(height), []);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ALIGN, InfoBox, INFOBOX_TYPE, useDevice } from "@lookiero/aurora";
|
|
3
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
4
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
5
5
|
|
|
6
6
|
const DeliveryBanner = () => {
|
|
7
7
|
const { screen } = useDevice();
|
|
@@ -10,7 +10,7 @@ const DeliveryBanner = () => {
|
|
|
10
10
|
<InfoBox
|
|
11
11
|
contentAlign={screen.L ? ALIGN.CENTER : undefined}
|
|
12
12
|
testID="delivery-banner"
|
|
13
|
-
text={useI18nMessage({ id: I18nMessages.CHECKOUT_DELIVERY_BANNER })}
|
|
13
|
+
text={useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_DELIVERY_BANNER })}
|
|
14
14
|
type={INFOBOX_TYPE.SQUARED}
|
|
15
15
|
/>
|
|
16
16
|
);
|
|
@@ -18,7 +18,7 @@ import { HostDefaultCheckoutQuestionItem } from "../../../../components/organism
|
|
|
18
18
|
import { HostSelectCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem";
|
|
19
19
|
import { IconCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem";
|
|
20
20
|
import { TextareaCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem";
|
|
21
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
21
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
22
22
|
|
|
23
23
|
const checkoutQuestionItems: CheckoutQuestionItems = {
|
|
24
24
|
[CheckoutQuestionType.HOST_DEFAULT]: HostDefaultCheckoutQuestionItem,
|
|
@@ -39,7 +39,7 @@ const CheckoutQuestionsForm: FC<CheckoutQuestionsFormProps> = ({
|
|
|
39
39
|
submitButtonDisabled,
|
|
40
40
|
onSubmit,
|
|
41
41
|
}) => {
|
|
42
|
-
const buttonText = useI18nMessage({ id: I18nMessages.FEEDBACK_BUTTON });
|
|
42
|
+
const buttonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_BUTTON });
|
|
43
43
|
|
|
44
44
|
const feedback = useCheckoutQuestionFeedback();
|
|
45
45
|
const handlePress = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
|
|
@@ -4,7 +4,7 @@ import { InfoBox, Text } from "@lookiero/aurora";
|
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { useScreenSize } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
7
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
8
8
|
import { style } from "./CustomerDecissionBanner.style";
|
|
9
9
|
|
|
10
10
|
type CustomerDecissionBannerStatus = Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL>;
|
|
@@ -20,8 +20,8 @@ interface CustomerDecissionBannerProps {
|
|
|
20
20
|
readonly onPress: () => void;
|
|
21
21
|
}
|
|
22
22
|
const CustomerDecissionBanner: FC<CustomerDecissionBannerProps> = ({ checkoutItemStatus, onPress }) => {
|
|
23
|
-
const decissionText = useI18nMessage({ id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
|
|
24
|
-
const bannerButtonText = useI18nMessage({ id: I18nMessages.ITEM_BANNER_BUTTON });
|
|
23
|
+
const decissionText = useI18nMessage({ domain: DOMAIN, id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
|
|
24
|
+
const bannerButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_BANNER_BUTTON });
|
|
25
25
|
const screenSize = useScreenSize();
|
|
26
26
|
const isSmallScreen = screenSize === "S";
|
|
27
27
|
|
package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { View } from "react-native";
|
|
|
3
3
|
import { ALIGN, Button, BUTTON_VARIANT, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
6
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./GetOutOfCheckoutModal.style";
|
|
8
8
|
|
|
9
9
|
interface GetOutOfCheckoutModalProps {
|
|
@@ -12,10 +12,16 @@ interface GetOutOfCheckoutModalProps {
|
|
|
12
12
|
readonly onConfirm: () => void;
|
|
13
13
|
}
|
|
14
14
|
const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps> = ({ visible, onDismiss, onConfirm }) => {
|
|
15
|
-
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
16
|
-
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
17
|
-
const dismissButtonText = useI18nMessage({
|
|
18
|
-
|
|
15
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
16
|
+
const descriptionText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
17
|
+
const dismissButtonText = useI18nMessage({
|
|
18
|
+
domain: DOMAIN,
|
|
19
|
+
id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON,
|
|
20
|
+
});
|
|
21
|
+
const confirmButtonText = useI18nMessage({
|
|
22
|
+
domain: DOMAIN,
|
|
23
|
+
id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON,
|
|
24
|
+
});
|
|
19
25
|
|
|
20
26
|
return (
|
|
21
27
|
<Modal portalHostName="Checkout" visible={visible} onClose={onDismiss}>
|
|
@@ -270,20 +270,13 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
270
270
|
"right": 0,
|
|
271
271
|
"top": 0,
|
|
272
272
|
},
|
|
273
|
-
"alignContent": "center",
|
|
274
273
|
"alignSelf": "flex-start",
|
|
275
|
-
"backgroundColor": "#0C0A0A",
|
|
276
|
-
"borderRadius": 9999,
|
|
277
274
|
"container": {
|
|
278
275
|
"overflow": "hidden",
|
|
279
276
|
},
|
|
280
277
|
"flex": 0,
|
|
281
278
|
"height": 64,
|
|
282
|
-
"justifyContent": "center",
|
|
283
279
|
"overflow": "hidden",
|
|
284
|
-
"paddingLeft": 24,
|
|
285
|
-
"paddingRight": 24,
|
|
286
|
-
"position": "relative",
|
|
287
280
|
"pressed": {
|
|
288
281
|
"bottom": 0,
|
|
289
282
|
"left": 0,
|
|
@@ -299,57 +292,98 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
299
292
|
]
|
|
300
293
|
}
|
|
301
294
|
>
|
|
302
|
-
<
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
295
|
+
<ViewManagerAdapter_ExpoLinearGradient
|
|
296
|
+
colors={
|
|
297
|
+
[
|
|
298
|
+
4278979082,
|
|
299
|
+
4278979082,
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
endPoint={
|
|
303
|
+
[
|
|
304
|
+
1,
|
|
305
|
+
0,
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
startPoint={
|
|
309
|
+
[
|
|
310
|
+
0,
|
|
311
|
+
1,
|
|
312
|
+
]
|
|
315
313
|
}
|
|
316
|
-
/>
|
|
317
|
-
<View
|
|
318
314
|
style={
|
|
319
315
|
[
|
|
320
316
|
{
|
|
321
|
-
"
|
|
322
|
-
"
|
|
317
|
+
"alignContent": "center",
|
|
318
|
+
"height": 64,
|
|
323
319
|
"justifyContent": "center",
|
|
320
|
+
"overflow": "hidden",
|
|
321
|
+
"paddingLeft": 24,
|
|
322
|
+
"paddingRight": 24,
|
|
323
|
+
"position": "relative",
|
|
324
|
+
},
|
|
325
|
+
{},
|
|
326
|
+
undefined,
|
|
327
|
+
undefined,
|
|
328
|
+
false,
|
|
329
|
+
{
|
|
330
|
+
"borderRadius": 9999,
|
|
324
331
|
},
|
|
325
332
|
]
|
|
326
333
|
}
|
|
327
334
|
>
|
|
328
|
-
<
|
|
329
|
-
|
|
330
|
-
|
|
335
|
+
<View
|
|
336
|
+
collapsable={false}
|
|
337
|
+
pointerEvents="none"
|
|
338
|
+
style={
|
|
339
|
+
{
|
|
340
|
+
"backgroundColor": "#716A6B",
|
|
341
|
+
"height": "300%",
|
|
342
|
+
"left": 0,
|
|
343
|
+
"opacity": 0.7,
|
|
344
|
+
"position": "absolute",
|
|
345
|
+
"top": 0,
|
|
346
|
+
"width": "0%",
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
/>
|
|
350
|
+
<View
|
|
331
351
|
style={
|
|
332
352
|
[
|
|
333
353
|
{
|
|
334
|
-
"
|
|
335
|
-
"
|
|
336
|
-
"
|
|
337
|
-
"letterSpacing": -0.2,
|
|
338
|
-
"lineHeight": 20,
|
|
339
|
-
"paddingBottom": 0,
|
|
340
|
-
"paddingLeft": 0,
|
|
341
|
-
"paddingRight": 0,
|
|
342
|
-
"paddingTop": 0,
|
|
343
|
-
"textAlign": "center",
|
|
344
|
-
"textTransform": "uppercase",
|
|
345
|
-
"width": "100%",
|
|
354
|
+
"alignItems": "center",
|
|
355
|
+
"flexDirection": "row",
|
|
356
|
+
"justifyContent": "center",
|
|
346
357
|
},
|
|
347
358
|
]
|
|
348
359
|
}
|
|
349
360
|
>
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
361
|
+
<Text
|
|
362
|
+
allowFontScaling={false}
|
|
363
|
+
selectable={false}
|
|
364
|
+
style={
|
|
365
|
+
[
|
|
366
|
+
{
|
|
367
|
+
"color": "#0C0A0A",
|
|
368
|
+
"fontFamily": "AreaNormal-Extrabold",
|
|
369
|
+
"fontSize": 15,
|
|
370
|
+
"letterSpacing": -0.2,
|
|
371
|
+
"lineHeight": 20,
|
|
372
|
+
"paddingBottom": 0,
|
|
373
|
+
"paddingLeft": 0,
|
|
374
|
+
"paddingRight": 0,
|
|
375
|
+
"paddingTop": 0,
|
|
376
|
+
"textAlign": "center",
|
|
377
|
+
"textTransform": "uppercase",
|
|
378
|
+
"width": "100%",
|
|
379
|
+
},
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
>
|
|
383
|
+
get_out_of_checkout_modal.dismiss_button
|
|
384
|
+
</Text>
|
|
385
|
+
</View>
|
|
386
|
+
</ViewManagerAdapter_ExpoLinearGradient>
|
|
353
387
|
</View>
|
|
354
388
|
<View
|
|
355
389
|
accessibilityRole="button"
|
|
@@ -396,24 +430,14 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
396
430
|
"right": 0,
|
|
397
431
|
"top": 0,
|
|
398
432
|
},
|
|
399
|
-
"alignContent": "center",
|
|
400
433
|
"alignSelf": "flex-start",
|
|
401
|
-
"backgroundColor": "#FFFFFF",
|
|
402
|
-
"borderColor": "#0C0A0A",
|
|
403
|
-
"borderRadius": 9999,
|
|
404
|
-
"borderStyle": "solid",
|
|
405
|
-
"borderWidth": 2,
|
|
406
434
|
"container": {
|
|
407
435
|
"overflow": "hidden",
|
|
408
436
|
},
|
|
409
437
|
"flex": 0,
|
|
410
438
|
"height": 64,
|
|
411
|
-
"justifyContent": "center",
|
|
412
439
|
"marginTop": 32,
|
|
413
440
|
"overflow": "hidden",
|
|
414
|
-
"paddingLeft": 24,
|
|
415
|
-
"paddingRight": 24,
|
|
416
|
-
"position": "relative",
|
|
417
441
|
"pressed": {
|
|
418
442
|
"bottom": 0,
|
|
419
443
|
"left": 0,
|
|
@@ -429,57 +453,105 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
429
453
|
]
|
|
430
454
|
}
|
|
431
455
|
>
|
|
432
|
-
<
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
456
|
+
<ViewManagerAdapter_ExpoLinearGradient
|
|
457
|
+
colors={
|
|
458
|
+
[
|
|
459
|
+
4294967295,
|
|
460
|
+
4294967295,
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
endPoint={
|
|
464
|
+
[
|
|
465
|
+
1,
|
|
466
|
+
0,
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
startPoint={
|
|
470
|
+
[
|
|
471
|
+
0,
|
|
472
|
+
1,
|
|
473
|
+
]
|
|
445
474
|
}
|
|
446
|
-
/>
|
|
447
|
-
<View
|
|
448
475
|
style={
|
|
449
476
|
[
|
|
450
477
|
{
|
|
451
|
-
"
|
|
452
|
-
"
|
|
478
|
+
"alignContent": "center",
|
|
479
|
+
"height": 64,
|
|
453
480
|
"justifyContent": "center",
|
|
481
|
+
"overflow": "hidden",
|
|
482
|
+
"paddingLeft": 24,
|
|
483
|
+
"paddingRight": 24,
|
|
484
|
+
"position": "relative",
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"borderColor": "#0C0A0A",
|
|
488
|
+
"borderStyle": "solid",
|
|
489
|
+
"borderWidth": 2,
|
|
490
|
+
"height": 64,
|
|
491
|
+
"paddingLeft": 24,
|
|
492
|
+
"paddingRight": 24,
|
|
493
|
+
},
|
|
494
|
+
undefined,
|
|
495
|
+
undefined,
|
|
496
|
+
false,
|
|
497
|
+
{
|
|
498
|
+
"borderRadius": 9999,
|
|
454
499
|
},
|
|
455
500
|
]
|
|
456
501
|
}
|
|
457
502
|
>
|
|
458
|
-
<
|
|
459
|
-
|
|
460
|
-
|
|
503
|
+
<View
|
|
504
|
+
collapsable={false}
|
|
505
|
+
pointerEvents="none"
|
|
506
|
+
style={
|
|
507
|
+
{
|
|
508
|
+
"backgroundColor": "#B7B3B3",
|
|
509
|
+
"height": "300%",
|
|
510
|
+
"left": 0,
|
|
511
|
+
"opacity": 0.7,
|
|
512
|
+
"position": "absolute",
|
|
513
|
+
"top": 0,
|
|
514
|
+
"width": "0%",
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
/>
|
|
518
|
+
<View
|
|
461
519
|
style={
|
|
462
520
|
[
|
|
463
521
|
{
|
|
464
|
-
"
|
|
465
|
-
"
|
|
466
|
-
"
|
|
467
|
-
"letterSpacing": -0.2,
|
|
468
|
-
"lineHeight": 20,
|
|
469
|
-
"paddingBottom": 0,
|
|
470
|
-
"paddingLeft": 0,
|
|
471
|
-
"paddingRight": 0,
|
|
472
|
-
"paddingTop": 0,
|
|
473
|
-
"textAlign": "center",
|
|
474
|
-
"textTransform": "uppercase",
|
|
475
|
-
"width": "100%",
|
|
522
|
+
"alignItems": "center",
|
|
523
|
+
"flexDirection": "row",
|
|
524
|
+
"justifyContent": "center",
|
|
476
525
|
},
|
|
477
526
|
]
|
|
478
527
|
}
|
|
479
528
|
>
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
529
|
+
<Text
|
|
530
|
+
allowFontScaling={false}
|
|
531
|
+
selectable={false}
|
|
532
|
+
style={
|
|
533
|
+
[
|
|
534
|
+
{
|
|
535
|
+
"color": "#0C0A0A",
|
|
536
|
+
"fontFamily": "AreaNormal-Extrabold",
|
|
537
|
+
"fontSize": 15,
|
|
538
|
+
"letterSpacing": -0.2,
|
|
539
|
+
"lineHeight": 20,
|
|
540
|
+
"paddingBottom": 0,
|
|
541
|
+
"paddingLeft": 0,
|
|
542
|
+
"paddingRight": 0,
|
|
543
|
+
"paddingTop": 0,
|
|
544
|
+
"textAlign": "center",
|
|
545
|
+
"textTransform": "uppercase",
|
|
546
|
+
"width": "100%",
|
|
547
|
+
},
|
|
548
|
+
]
|
|
549
|
+
}
|
|
550
|
+
>
|
|
551
|
+
get_out_of_checkout_modal.confirm_button
|
|
552
|
+
</Text>
|
|
553
|
+
</View>
|
|
554
|
+
</ViewManagerAdapter_ExpoLinearGradient>
|
|
483
555
|
</View>
|
|
484
556
|
</View>
|
|
485
557
|
</View>
|
|
@@ -7,7 +7,7 @@ import { Sticky } from "@lookiero/sty-psp-ui";
|
|
|
7
7
|
import { ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
|
|
8
8
|
import { size } from "../../../../../../projection/size/size";
|
|
9
9
|
import { Body } from "../../../../components/layouts/body/Body";
|
|
10
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
10
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
11
11
|
import { SelectModal } from "../selectModal/SelectModal";
|
|
12
12
|
import { style } from "./ItemActions.style";
|
|
13
13
|
|
|
@@ -33,9 +33,9 @@ const ItemActions: FC<ItemActionsProps> = ({
|
|
|
33
33
|
}) => {
|
|
34
34
|
const [modalVisible, setModalVisible] = useState(false);
|
|
35
35
|
|
|
36
|
-
const changeSizeButtonText = useI18nMessage({ id: I18nMessages.ITEM_CHANGE_SIZE_BUTTON });
|
|
37
|
-
const keepButtonText = useI18nMessage({ id: I18nMessages.ITEM_KEEP_BUTTON });
|
|
38
|
-
const returnButtonText = useI18nMessage({ id: I18nMessages.ITEM_RETURN_BUTTON });
|
|
36
|
+
const changeSizeButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_CHANGE_SIZE_BUTTON });
|
|
37
|
+
const keepButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_KEEP_BUTTON });
|
|
38
|
+
const returnButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_RETURN_BUTTON });
|
|
39
39
|
|
|
40
40
|
const sizeSelectorOptions = useMemo(
|
|
41
41
|
() =>
|