@lookiero/checkout 9.12.0 → 9.14.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/Expo.js +2 -0
- package/dist/src/ExpoRoot.js +6 -5
- 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 +7 -7
- package/src/Expo.tsx +3 -0
- package/src/ExpoRoot.tsx +6 -5
- 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/itemActions/ItemActions.tsx +4 -4
- 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/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/pricing/Pricing.tsx +8 -6
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +5 -5
package/dist/index.js
CHANGED
|
@@ -5,12 +5,13 @@ import { Segment } from "@lookiero/sty-psp-segment";
|
|
|
5
5
|
import { CheckoutStatus } from "./src/domain/checkout/model/checkout";
|
|
6
6
|
import { bootstrap as checkoutBootstrap } from "./src/infrastructure/delivery/bootstrap";
|
|
7
7
|
import { root } from "./src/infrastructure/ui/Root";
|
|
8
|
+
import { DOMAIN } from "./src/infrastructure/ui/i18n/i18n";
|
|
8
9
|
import { viewFirstAvailableCheckoutByCustomerId } from "./src/projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
9
10
|
const bootstrap = ({ apiUrl, getAuthToken, translations, sentry, kameleoon }) => {
|
|
10
11
|
const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
|
|
11
12
|
const I18n = i18n({
|
|
12
13
|
fetchTranslation: fetchTranslations({ translations }),
|
|
13
|
-
domain:
|
|
14
|
+
domain: DOMAIN,
|
|
14
15
|
});
|
|
15
16
|
const firstAvailableCheckoutByCustomerId = ({ customerId }) => queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId: customerId }));
|
|
16
17
|
return {
|
package/dist/src/Expo.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { registerRootComponent } from "expo";
|
|
2
|
+
import { enableLegacyWebImplementation } from "react-native-gesture-handler";
|
|
2
3
|
import "react-native-get-random-values";
|
|
3
4
|
import { ExpoRoot } from "./ExpoRoot";
|
|
5
|
+
enableLegacyWebImplementation(true);
|
|
4
6
|
registerRootComponent(ExpoRoot);
|
package/dist/src/ExpoRoot.js
CHANGED
|
@@ -14,9 +14,10 @@ import { DummyLayout } from "@lookiero/sty-psp-ui";
|
|
|
14
14
|
import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
|
|
15
15
|
import { bootstrap as checkoutMockBootstrap } from "./infrastructure/delivery/bootstrap.mock";
|
|
16
16
|
import { root } from "./infrastructure/ui/Root";
|
|
17
|
+
import { DOMAIN } from "./infrastructure/ui/i18n/i18n";
|
|
17
18
|
import { Router } from "./infrastructure/ui/routing/router/Router";
|
|
18
19
|
import { VERSION } from "./version";
|
|
19
|
-
const locale = Locale.
|
|
20
|
+
const locale = Locale.en_GB;
|
|
20
21
|
const subscription = "b";
|
|
21
22
|
const order = {
|
|
22
23
|
isFirstOrder: false,
|
|
@@ -24,7 +25,7 @@ const order = {
|
|
|
24
25
|
coupon: "MYLOOKIERO",
|
|
25
26
|
};
|
|
26
27
|
const customer = {
|
|
27
|
-
customerId: "
|
|
28
|
+
customerId: "a4355713-469b-4684-bf90-3215702dfb1c",
|
|
28
29
|
country: Country.ES,
|
|
29
30
|
segment: Segment.WOMEN,
|
|
30
31
|
};
|
|
@@ -39,7 +40,7 @@ const apiUrl = Platform.OS !== "web"
|
|
|
39
40
|
: __DEV__
|
|
40
41
|
? "/local-to-dev"
|
|
41
42
|
: "/checkout/api";
|
|
42
|
-
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
43
|
+
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2ODkxMDAsImV4cCI6MTc0NjI3ODQwMiwiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjUtMDQtMDMiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiYTQzNTU3MTMtNDY5Yi00Njg0LWJmOTAtMzIxNTcwMmRmYjFjIiwiaWF0IjoxNzQzNjg2NDAyfQ.pmqFo-4s0USFpzCnijRt78bWuBdu2Q7f4L9UtOkfAwo";
|
|
43
44
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
44
45
|
const externalTranslationsUrl = Platform.OS !== "web"
|
|
45
46
|
? "https://backend-for-user.dev.envs.lookiero.tech/api/v2/translations"
|
|
@@ -49,7 +50,7 @@ const externalTranslationsUrl = Platform.OS !== "web"
|
|
|
49
50
|
const translations = [
|
|
50
51
|
(locale) => translationExternalEndpoint({
|
|
51
52
|
translationsUrl: externalTranslationsUrl,
|
|
52
|
-
projects: [["
|
|
53
|
+
projects: [["checkout"]],
|
|
53
54
|
})(locale),
|
|
54
55
|
];
|
|
55
56
|
const useRedirect = () => ({
|
|
@@ -84,7 +85,7 @@ const { Component: Messaging, queryBus } = process.env.EXPO_PUBLIC_APP_VARIANT =
|
|
|
84
85
|
: checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
|
|
85
86
|
const I18n = i18n({
|
|
86
87
|
fetchTranslation: fetchTranslations({ translations }),
|
|
87
|
-
domain:
|
|
88
|
+
domain: DOMAIN,
|
|
88
89
|
});
|
|
89
90
|
const Root = root({
|
|
90
91
|
Messaging,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ALIGN, DISPLAY, InfoBox, INFOBOX_TYPE, 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 { style } from "./FiveItemsDiscountBanner.style";
|
|
6
6
|
const FiveItemsDiscountBanner = ({ fiveItemsDiscount }) => {
|
|
7
7
|
const bannerText = useI18nMessage({
|
|
8
|
+
domain: DOMAIN,
|
|
8
9
|
id: I18nMessages.BANNER_DISCOUNT_TEXT,
|
|
9
10
|
values: {
|
|
10
11
|
discount: fiveItemsDiscount.toString(),
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nNumber } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../i18n/i18n";
|
|
5
6
|
import { style } from "./Price.style";
|
|
6
7
|
const PRICE_VARIANT = {
|
|
7
8
|
default: { detail: true, level: 1 },
|
|
@@ -12,11 +13,13 @@ const PRICE_VARIANT = {
|
|
|
12
13
|
const Price = ({ price, variant = "default", withPercentage = false }) => {
|
|
13
14
|
const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
|
|
14
15
|
const productPrice = useI18nNumber({
|
|
16
|
+
domain: DOMAIN,
|
|
15
17
|
value: price.amount / 100,
|
|
16
18
|
style: "currency",
|
|
17
19
|
currency: price.currency,
|
|
18
20
|
});
|
|
19
21
|
const productDiscountedPrice = useI18nNumber({
|
|
22
|
+
domain: DOMAIN,
|
|
20
23
|
value: (price.discountedPrice?.amount || 0) / 100,
|
|
21
24
|
style: "currency",
|
|
22
25
|
currency: price.currency,
|
|
@@ -2,12 +2,13 @@ import React, { useCallback } from "react";
|
|
|
2
2
|
import { TouchableOpacity } from "react-native";
|
|
3
3
|
import { ALIGN, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
6
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
6
7
|
import { style } from "./ButtonCheckoutQuestionItem.style";
|
|
7
8
|
const ACTIVE_OPACITY = 0.6;
|
|
8
9
|
const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
|
|
9
10
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
10
|
-
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
11
|
+
const optionText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
11
12
|
const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
|
|
12
13
|
return (React.createElement(TouchableOpacity, { accessibilityLabel: testID, activeOpacity: ACTIVE_OPACITY, style: [style.button, feedback === checkoutQuestion.id && style.buttonActive], testID: testID, onPress: handleOnPress },
|
|
13
14
|
React.createElement(Text, { align: ALIGN.CENTER, level: 3, style: feedback === checkoutQuestion.id && style.textActive, action: true }, optionText)));
|
|
@@ -2,9 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
6
|
import { style } from "./HostDefaultCheckoutQuestionItem.style";
|
|
6
7
|
const HostDefaultCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
|
|
7
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
8
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
8
9
|
return (React.createElement(React.Fragment, null,
|
|
9
10
|
React.createElement(Text, { level: 3, style: style.title }, titleText),
|
|
10
11
|
React.createElement(View, { style: style.content }, children)));
|
|
@@ -2,9 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
6
|
import { style } from "./HostSelectCheckoutQuestionItem.style";
|
|
6
7
|
const HostSelectCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
|
|
7
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
8
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
8
9
|
return (React.createElement(React.Fragment, null,
|
|
9
10
|
React.createElement(Text, { level: 3, style: style.title }, titleText),
|
|
10
11
|
React.createElement(View, { style: style.content }, children)));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
3
3
|
import { InputField, TextInput } from "@lookiero/sty-psp-ui";
|
|
4
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
4
5
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
5
6
|
import { style } from "./TextareaCheckoutQuestionItem.style";
|
|
6
7
|
const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
|
|
7
|
-
const { formatMessage } =
|
|
8
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
8
9
|
const placeholderText = useMemo(() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""), [formatMessage, checkoutQuestion.placeholder]);
|
|
9
10
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
10
11
|
const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Text, View } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
4
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
5
5
|
import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
6
|
-
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
6
|
+
import { DOMAIN, I18nMessages } from "../../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./HostDefaultReturnQuestionItem.style";
|
|
8
8
|
const HostDefaultReturnQuestionItem = ({ returnQuestion, children, }) => {
|
|
9
|
-
const { formatMessage } =
|
|
9
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
10
10
|
const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
|
|
11
11
|
return (React.createElement(React.Fragment, null,
|
|
12
12
|
returnQuestionWithTranslationKey(returnQuestion) && returnQuestion.translationKey !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
|
-
import {
|
|
5
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
6
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
7
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
7
8
|
const HostRadioGroupReturnQuestionItem = ({ returnQuestion, children, testID, }) => {
|
|
8
|
-
const { formatMessage } =
|
|
9
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
9
10
|
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
10
11
|
return (React.createElement(React.Fragment, null,
|
|
11
12
|
React.createElement(View, { style: style.wrapper, testID: testID },
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { TouchableHighlight, View } from "react-native";
|
|
4
4
|
import { ButtonIcon } from "@lookiero/aurora";
|
|
5
|
-
import {
|
|
5
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
6
6
|
import { InputField, Modal, TextInput } from "@lookiero/sty-psp-ui";
|
|
7
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
8
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
9
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
9
10
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
10
11
|
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, testID, }) => {
|
|
11
|
-
const { formatMessage } =
|
|
12
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
12
13
|
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
13
14
|
const [modalVisible, setModalVisible] = useState(false);
|
|
14
15
|
const handleOnPress = useCallback(() => setModalVisible(true), []);
|
|
15
16
|
const handleOnModalClose = useCallback(() => setModalVisible(false), []);
|
|
16
17
|
const feedback = useReturnQuestionFeedback();
|
|
17
18
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
18
|
-
const
|
|
19
|
-
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
19
|
+
const translate = useCallback((returnQuestionName) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [formatMessage]);
|
|
20
20
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
21
21
|
const [deepestReturnQuestionWithFeedback, isLeaf] = deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
22
22
|
feedback,
|
|
@@ -3,13 +3,14 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
5
5
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
6
|
-
import {
|
|
6
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
7
7
|
import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
8
|
+
import { DOMAIN } from "../../../../../../i18n/i18n";
|
|
8
9
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
9
10
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
10
11
|
import { style } from "./HostStackReturnQuestionItem.style";
|
|
11
12
|
const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
12
|
-
const { formatMessage } =
|
|
13
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
13
14
|
const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
14
15
|
const feedbackReturnQuestion = feedback
|
|
15
16
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
4
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
7
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
8
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
8
9
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
9
10
|
const ModalOptionReturnQuestionItems = ({ portalHostName, returnQuestion, visible, onClose, }) => {
|
|
10
|
-
const { formatMessage } =
|
|
11
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
11
12
|
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
12
13
|
return (React.createElement(Modal, { portalHostName: portalHostName, visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
13
14
|
React.createElement(View, { style: style.modalContent },
|
|
@@ -3,11 +3,12 @@ import React, { useCallback } from "react";
|
|
|
3
3
|
import { TouchableHighlight } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
7
8
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
8
9
|
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
9
10
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
10
|
-
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
11
|
+
const optionText = useI18nMessage({ domain: DOMAIN, id: returnQuestion.translationKey });
|
|
11
12
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParent.id]);
|
|
12
13
|
return (React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: style.container, testID: testID, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
13
14
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React, { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import { View, Option, OPTION_VARIANT, SIZE } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
4
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
6
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
7
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
7
8
|
import { ModalOptionReturnQuestionItems } from "../modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems";
|
|
8
9
|
import { style } from "./RadioReturnQuestionItem.style";
|
|
9
10
|
const RadioReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, portalHostName, }) => {
|
|
10
|
-
const
|
|
11
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
11
12
|
const [modalVisible, setModalVisible] = useState(false);
|
|
12
13
|
const { feedback: feedbackId, onChange, clear, } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
13
14
|
const feedback = useReturnQuestionFeedback();
|
|
14
|
-
const translate = useCallback((returnQuestionName) =>
|
|
15
|
+
const translate = useCallback((returnQuestionName) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [formatMessage]);
|
|
15
16
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
16
|
-
const optionText =
|
|
17
|
+
const optionText = formatMessage({ id: returnQuestion.translationKey });
|
|
17
18
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
18
19
|
const handleOnModalClose = useCallback(() => {
|
|
19
20
|
// Uncomment if we want to clear current selection (and update callback's dependencies)
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
|
-
import { useI18nMessage,
|
|
6
|
-
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
5
|
+
import { useI18nMessage, useI18n } from "@lookiero/i18n-react";
|
|
6
|
+
import { DOMAIN, I18nMessages } from "../../../../../i18n/i18n";
|
|
7
7
|
import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
8
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
9
9
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
10
10
|
const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
|
|
11
|
-
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
12
|
-
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
11
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: returnQuestion.translationKey });
|
|
12
|
+
const unansweredText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
13
13
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
14
|
-
const
|
|
15
|
-
const translate = useCallback((returnQuestionName) =>
|
|
14
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
15
|
+
const translate = useCallback((returnQuestionName) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [formatMessage]);
|
|
16
16
|
const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(" / ");
|
|
17
17
|
return (React.createElement(View, { style: style.container },
|
|
18
18
|
React.createElement(Text, { level: 2, style: style.title, detailBold: true }, titleText),
|
|
@@ -1,12 +1,13 @@
|
|
|
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
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
7
8
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
8
9
|
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
9
|
-
const { formatMessage } =
|
|
10
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
10
11
|
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
11
12
|
const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
12
13
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: value }), [onChange, returnQuestionParent.id]);
|
package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React 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";
|
|
8
8
|
const CheckoutHeader = ({ onBack }) => {
|
|
9
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_COMPLETE_CHECKOUT_TITLE });
|
|
9
|
+
const title = useI18nMessage({ domain: DOMAIN, id: I18nMessages.HEADER_COMPLETE_CHECKOUT_TITLE });
|
|
10
10
|
return (React.createElement(Header, { testID: "checkout-header" },
|
|
11
11
|
React.createElement(ButtonIcon, { name: "arrow_left", style: style.button, testID: "arrow-left-button-icon", onPress: onBack }),
|
|
12
12
|
React.createElement(Text, { level: 3, action: true }, title),
|
package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React 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";
|
|
8
8
|
const ItemDetailHeader = ({ onBack }) => {
|
|
9
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
9
|
+
const title = useI18nMessage({ domain: DOMAIN, id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
10
10
|
return (React.createElement(Header, { testID: "item-detail-header" },
|
|
11
11
|
React.createElement(ButtonIconPlaceholder, null),
|
|
12
12
|
React.createElement(Text, { level: 3, action: true }, title),
|
|
@@ -2,14 +2,14 @@ import React, { useCallback } from "react";
|
|
|
2
2
|
import { generatePath, useNavigate } from "react-router-native";
|
|
3
3
|
import { ButtonIcon, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
5
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
6
6
|
import { Routes } from "../../../../routing/routes";
|
|
7
7
|
import { useBasePath } from "../../../../routing/useBasePath";
|
|
8
8
|
import { Header } from "../Header";
|
|
9
9
|
import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
|
|
10
10
|
import style from "./ItemHeader.style";
|
|
11
11
|
const ItemHeader = ({ items, item, onNext, onPrevious }) => {
|
|
12
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
12
|
+
const title = useI18nMessage({ domain: DOMAIN, id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
13
13
|
const itemIndex = items.indexOf(item);
|
|
14
14
|
const isFirstItem = itemIndex === 0;
|
|
15
15
|
const isLastItem = itemIndex === items.length - 1;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
declare const DOMAIN = "CheckoutI18n";
|
|
1
2
|
declare const COLOR_I18N_PREFIX = "catalog.color.";
|
|
2
3
|
declare enum I18nMessages {
|
|
3
4
|
TOAST_GENERIC_ERROR = "toast_generic_error",
|
|
@@ -55,4 +56,4 @@ declare enum I18nMessages {
|
|
|
55
56
|
FEEDBACK_BUTTON = "feedback.button",
|
|
56
57
|
CHECKOUT_TOAST_BOOKING_EXPIRED = "checkout.toast_booking_expired"
|
|
57
58
|
}
|
|
58
|
-
export { I18nMessages, COLOR_I18N_PREFIX };
|
|
59
|
+
export { DOMAIN, I18nMessages, COLOR_I18N_PREFIX };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const DOMAIN = "CheckoutI18n";
|
|
1
2
|
// TODO: deprecated?
|
|
2
3
|
const COLOR_I18N_PREFIX = "catalog.color.";
|
|
3
4
|
var I18nMessages;
|
|
@@ -57,4 +58,4 @@ var I18nMessages;
|
|
|
57
58
|
I18nMessages["FEEDBACK_BUTTON"] = "feedback.button";
|
|
58
59
|
I18nMessages["CHECKOUT_TOAST_BOOKING_EXPIRED"] = "checkout.toast_booking_expired";
|
|
59
60
|
})(I18nMessages || (I18nMessages = {}));
|
|
60
|
-
export { I18nMessages, COLOR_I18N_PREFIX };
|
|
61
|
+
export { DOMAIN, I18nMessages, COLOR_I18N_PREFIX };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { render } from "@testing-library/react-native";
|
|
2
2
|
import { mock } from "jest-mock-extended";
|
|
3
3
|
import React, { Fragment } 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 { LoggerProvider } from "@lookiero/sty-psp-logging";
|
|
7
|
+
import { DOMAIN } from "../i18n/i18n";
|
|
7
8
|
import { BasePathProvider } from "../routing/useBasePath";
|
|
9
|
+
const I18nProvider = createI18nProvider({ domain: DOMAIN });
|
|
8
10
|
const renderWrapper = ({ locale, messages = {}, wrapper: Wrapper = Fragment, logger = mock() }) =>
|
|
9
11
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
10
12
|
({ children }) => (React.createElement(Aurora, null,
|
|
11
|
-
React.createElement(
|
|
13
|
+
React.createElement(I18nProvider, { locale: locale, messages: messages, onError: () => void 0 },
|
|
12
14
|
React.createElement(LoggerProvider, { logger: logger },
|
|
13
15
|
React.createElement(BasePathProvider, { basePath: "" },
|
|
14
16
|
React.createElement(Wrapper, null, children))))));
|
|
@@ -6,10 +6,11 @@ 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
|
const { colorBgBase } = theme();
|
|
10
11
|
const App = ({ children }) => (React.createElement(SafeAreaProvider, null,
|
|
11
12
|
React.createElement(PortalProvider, { rootHostName: "Checkout" },
|
|
12
13
|
React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
|
|
13
|
-
React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID, portalHostName: "Checkout" }),
|
|
14
|
+
React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID, domain: DOMAIN, portalHostName: "Checkout" }),
|
|
14
15
|
React.createElement(AuroraPortalProvider, null, children))));
|
|
15
16
|
export { App };
|
|
@@ -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";
|
|
@@ -25,8 +25,8 @@ import { DeliveryBanner } from "./components/deliveryBanner/DeliveryBanner";
|
|
|
25
25
|
import { PaymentInstrument } from "./components/paymentInstrument/PaymentInstrument";
|
|
26
26
|
const Checkout = ({ children, layout: Layout, useRedirect }) => {
|
|
27
27
|
const { customer: { customerId, country, segment }, } = useStaticInfo();
|
|
28
|
-
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
|
|
29
|
-
const submitButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
28
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_TITLE });
|
|
29
|
+
const submitButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
30
30
|
const { screen } = useDevice();
|
|
31
31
|
const [pricingHeight, setPricingHeight] = useState(0);
|
|
32
32
|
const handleOnPricingLayout = useCallback(({ height }) => setPricingHeight(height), []);
|
package/dist/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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
|
const DeliveryBanner = () => {
|
|
6
6
|
const { screen } = useDevice();
|
|
7
|
-
return (React.createElement(InfoBox, { contentAlign: screen.L ? ALIGN.CENTER : undefined, testID: "delivery-banner", text: useI18nMessage({ id: I18nMessages.CHECKOUT_DELIVERY_BANNER }), type: INFOBOX_TYPE.SQUARED }));
|
|
7
|
+
return (React.createElement(InfoBox, { contentAlign: screen.L ? ALIGN.CENTER : undefined, testID: "delivery-banner", text: useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_DELIVERY_BANNER }), type: INFOBOX_TYPE.SQUARED }));
|
|
8
8
|
};
|
|
9
9
|
export { DeliveryBanner };
|
|
@@ -11,7 +11,7 @@ import { HostDefaultCheckoutQuestionItem } from "../../../../components/organism
|
|
|
11
11
|
import { HostSelectCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem";
|
|
12
12
|
import { IconCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem";
|
|
13
13
|
import { TextareaCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem";
|
|
14
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
14
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
15
15
|
const checkoutQuestionItems = {
|
|
16
16
|
[CheckoutQuestionType.HOST_DEFAULT]: HostDefaultCheckoutQuestionItem,
|
|
17
17
|
[CheckoutQuestionType.HOST_TEXTAREA]: HostDefaultCheckoutQuestionItem,
|
|
@@ -21,7 +21,7 @@ const checkoutQuestionItems = {
|
|
|
21
21
|
[CheckoutQuestionType.BUTTON]: ButtonCheckoutQuestionItem,
|
|
22
22
|
};
|
|
23
23
|
const CheckoutQuestionsForm = ({ checkoutQuestions, submitButtonDisabled, onSubmit, }) => {
|
|
24
|
-
const buttonText = useI18nMessage({ id: I18nMessages.FEEDBACK_BUTTON });
|
|
24
|
+
const buttonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_BUTTON });
|
|
25
25
|
const feedback = useCheckoutQuestionFeedback();
|
|
26
26
|
const handlePress = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
|
|
27
27
|
const filteredCheckoutQuestions = useMemo(() => {
|
|
@@ -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
|
const i18nMessageForCheckoutItemStatus = {
|
|
10
10
|
[CheckoutItemStatus.KEPT]: I18nMessages.ITEM_BANNER_CUSTOMER_KEPT_DECISSION,
|
|
@@ -12,8 +12,8 @@ const i18nMessageForCheckoutItemStatus = {
|
|
|
12
12
|
[CheckoutItemStatus.RETURNED]: I18nMessages.ITEM_BANNER_CUSTOMER_RETURNED_DECISSION,
|
|
13
13
|
};
|
|
14
14
|
const CustomerDecissionBanner = ({ checkoutItemStatus, onPress }) => {
|
|
15
|
-
const decissionText = useI18nMessage({ id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
|
|
16
|
-
const bannerButtonText = useI18nMessage({ id: I18nMessages.ITEM_BANNER_BUTTON });
|
|
15
|
+
const decissionText = useI18nMessage({ domain: DOMAIN, id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
|
|
16
|
+
const bannerButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_BANNER_BUTTON });
|
|
17
17
|
const screenSize = useScreenSize();
|
|
18
18
|
const isSmallScreen = screenSize === "S";
|
|
19
19
|
return (React.createElement(View, { style: [style.container, isSmallScreen ? style.smallContainer : null] },
|
|
@@ -3,13 +3,19 @@ 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
|
const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
|
|
9
|
-
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
10
|
-
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
11
|
-
const dismissButtonText = useI18nMessage({
|
|
12
|
-
|
|
9
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
10
|
+
const descriptionText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
11
|
+
const dismissButtonText = useI18nMessage({
|
|
12
|
+
domain: DOMAIN,
|
|
13
|
+
id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON,
|
|
14
|
+
});
|
|
15
|
+
const confirmButtonText = useI18nMessage({
|
|
16
|
+
domain: DOMAIN,
|
|
17
|
+
id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON,
|
|
18
|
+
});
|
|
13
19
|
return (React.createElement(Modal, { portalHostName: "Checkout", visible: visible, onClose: onDismiss },
|
|
14
20
|
React.createElement(View, { style: style.modalContent },
|
|
15
21
|
React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
|
|
@@ -5,14 +5,14 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
5
5
|
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { size } from "../../../../../../projection/size/size";
|
|
7
7
|
import { Body } from "../../../../components/layouts/body/Body";
|
|
8
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
9
9
|
import { SelectModal } from "../selectModal/SelectModal";
|
|
10
10
|
import { style } from "./ItemActions.style";
|
|
11
11
|
const ItemActions = ({ productVariants, currentProductVariant, country, onShowSizeWithoutStockModal = () => void 0, onKeep, onReplace, onReturn, onLayout, }) => {
|
|
12
12
|
const [modalVisible, setModalVisible] = useState(false);
|
|
13
|
-
const changeSizeButtonText = useI18nMessage({ id: I18nMessages.ITEM_CHANGE_SIZE_BUTTON });
|
|
14
|
-
const keepButtonText = useI18nMessage({ id: I18nMessages.ITEM_KEEP_BUTTON });
|
|
15
|
-
const returnButtonText = useI18nMessage({ id: I18nMessages.ITEM_RETURN_BUTTON });
|
|
13
|
+
const changeSizeButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_CHANGE_SIZE_BUTTON });
|
|
14
|
+
const keepButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_KEEP_BUTTON });
|
|
15
|
+
const returnButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_RETURN_BUTTON });
|
|
16
16
|
const sizeSelectorOptions = useMemo(() => (productVariants || []).map((productVariant) => ({
|
|
17
17
|
label: size({ size: productVariant.size, country }),
|
|
18
18
|
value: productVariant.id,
|
|
@@ -5,11 +5,11 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
5
5
|
import { useScreenSize } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { size } from "../../../../../../projection/size/size";
|
|
7
7
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
8
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
9
9
|
import { style } from "./ProductVariantDescription.style";
|
|
10
10
|
const ProductVariantDescription = ({ brand, name, price, size: sizeProjection, country, }) => {
|
|
11
|
-
const sizeText = useI18nMessage({ id: I18nMessages.ITEM_SIZE });
|
|
12
|
-
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
11
|
+
const sizeText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_SIZE });
|
|
12
|
+
const uniqueText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_UNIQUE });
|
|
13
13
|
const screenDevice = useScreenSize();
|
|
14
14
|
const isDesktopScreen = screenDevice !== "S";
|
|
15
15
|
return (React.createElement(View, { style: [style.container, isDesktopScreen ? null : style.smallContainer] },
|