@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
|
@@ -7,7 +7,7 @@ import { ReturnQuestions } from "../../../../components/organisms/returnQuestion
|
|
|
7
7
|
import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
8
8
|
import { HostDefaultReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem";
|
|
9
9
|
import { ReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem";
|
|
10
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
10
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
11
11
|
import { style } from "./ReturnQuestionsFeedback.style";
|
|
12
12
|
const returnQuestionItems = {
|
|
13
13
|
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionFeedbackItem,
|
|
@@ -18,7 +18,7 @@ const returnQuestionItems = {
|
|
|
18
18
|
[ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
|
|
19
19
|
};
|
|
20
20
|
const ReturnQuestionsFeedback = ({ returnQuestions, onEditFeedback }) => {
|
|
21
|
-
const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE });
|
|
21
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_TITLE });
|
|
22
22
|
return (React.createElement(View, null,
|
|
23
23
|
React.createElement(View, { style: style.titleContainer },
|
|
24
24
|
React.createElement(Text, { level: 2 }, titleText),
|
|
@@ -3,12 +3,12 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Button, 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 "./SizeWithoutStockModal.style";
|
|
8
8
|
const SizeWithoutStockModal = ({ visible, onDismiss }) => {
|
|
9
|
-
const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
|
|
10
|
-
const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
|
|
11
|
-
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
9
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
|
|
10
|
+
const descriptionText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
|
|
11
|
+
const buttonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
12
12
|
return (React.createElement(Modal, { portalHostName: "Checkout", visible: visible, showCloseButton: true, onClose: onDismiss },
|
|
13
13
|
React.createElement(View, { style: style.modalContent },
|
|
14
14
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
@@ -2,15 +2,18 @@ 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 = ({ price, withPercentage = false }) => {
|
|
7
8
|
const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
|
|
8
9
|
const productPrice = useI18nNumber({
|
|
10
|
+
domain: DOMAIN,
|
|
9
11
|
value: price.amount / 100,
|
|
10
12
|
style: "currency",
|
|
11
13
|
currency: price.currency,
|
|
12
14
|
});
|
|
13
15
|
const productDiscountedPrice = useI18nNumber({
|
|
16
|
+
domain: DOMAIN,
|
|
14
17
|
value: (price.discountedPrice?.amount || 0) / 100,
|
|
15
18
|
style: "currency",
|
|
16
19
|
currency: price.currency,
|
|
@@ -5,14 +5,14 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
5
5
|
import { Column, Row } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { size } from "../../../../../../projection/size/size";
|
|
7
7
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
8
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
9
9
|
import { Price } from "../price/Price";
|
|
10
10
|
import { IMAGE_SIZE, style } from "./ProductVariantPreview.style";
|
|
11
11
|
const ProductVariantPreview = ({ item, country }) => {
|
|
12
12
|
const cdnImageUrl = useMediaImage();
|
|
13
13
|
const { screen } = useDevice();
|
|
14
|
-
const sizeText = useI18nMessage({ id: I18nMessages.ITEM_SIZE });
|
|
15
|
-
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
14
|
+
const sizeText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_SIZE });
|
|
15
|
+
const uniqueText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_UNIQUE });
|
|
16
16
|
const { productVariant: { media, brand, name, size: sizeProjection }, price, } = item;
|
|
17
17
|
const mainImage = media.find((mediaElement) => mediaElement.perspective === "MAIN");
|
|
18
18
|
return (React.createElement(View, { style: [style.wrapper, !screen.S && style.mobileWrapper], testID: "product-variant-preview" },
|
|
@@ -24,7 +24,7 @@ import { HostStackReturnQuestionItem } from "../../../../components/organisms/re
|
|
|
24
24
|
import { RadioReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem";
|
|
25
25
|
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
26
26
|
import { ItemDetailHeader } from "../../../../components/templates/header/itemDetailHeader/ItemDetailHeader";
|
|
27
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
27
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
28
28
|
import { Routes } from "../../../../routing/routes";
|
|
29
29
|
import { useBasePath } from "../../../../routing/useBasePath";
|
|
30
30
|
import { ProductVariantPreview } from "../productVariantPreview/ProductVariantPreview";
|
|
@@ -43,9 +43,9 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
|
|
|
43
43
|
const basePath = useBasePath();
|
|
44
44
|
const logger = useLogger();
|
|
45
45
|
const { screen } = useDevice();
|
|
46
|
-
const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
|
|
47
|
-
const descriptionText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_DESCRIPTION });
|
|
48
|
-
const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
|
|
46
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.RETURN_QUESTIONS_TITLE });
|
|
47
|
+
const descriptionText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.RETURN_QUESTIONS_DESCRIPTION });
|
|
48
|
+
const submitButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
|
|
49
49
|
const feedback = useReturnQuestionFeedback();
|
|
50
50
|
const [returnQuestions] = useListReturnQuestionsByCheckoutItemId({
|
|
51
51
|
checkoutItemId: checkoutItem.id,
|
|
@@ -7,12 +7,12 @@ import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/
|
|
|
7
7
|
import { size } from "../../../../../../projection/size/size";
|
|
8
8
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
9
9
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
10
|
-
import { COLOR_I18N_PREFIX, I18nMessages } from "../../../../i18n/i18n";
|
|
10
|
+
import { COLOR_I18N_PREFIX, DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
11
11
|
import { IMAGE_WIDTH, style } from "./ProductVariant.style";
|
|
12
12
|
const ProductVariant = ({ media, brand, name, price, size: sizeProjection, color, status, country, style: customStyle, onPress, }) => {
|
|
13
|
-
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
14
|
-
const colorLabel = useI18nMessage({ id: color.name, prefix: COLOR_I18N_PREFIX });
|
|
15
|
-
const sizeChangeText = useI18nMessage({ id: I18nMessages.PRODUCT_VARIANT_SIZE_CHANGE });
|
|
13
|
+
const uniqueText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_UNIQUE });
|
|
14
|
+
const colorLabel = useI18nMessage({ domain: DOMAIN, id: color.name, prefix: COLOR_I18N_PREFIX });
|
|
15
|
+
const sizeChangeText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.PRODUCT_VARIANT_SIZE_CHANGE });
|
|
16
16
|
const cdnImageUrl = useMediaImage();
|
|
17
17
|
return (React.createElement(Pressable, { pointerEvents: onPress ? "auto" : "none", style: style.container, testID: "product-variant", onPress: onPress },
|
|
18
18
|
React.createElement(View, { style: style.row },
|
|
@@ -16,7 +16,7 @@ import { useTrackPressPricing } from "../../../tracking/useTrackPressPricing";
|
|
|
16
16
|
import { FiveItemsDiscountBanner } from "../../components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
|
|
17
17
|
import { Body } from "../../components/layouts/body/Body";
|
|
18
18
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
19
|
-
import { I18nMessages } from "../../i18n/i18n";
|
|
19
|
+
import { DOMAIN, I18nMessages } from "../../i18n/i18n";
|
|
20
20
|
import { Routes } from "../../routing/routes";
|
|
21
21
|
import { useBasePath } from "../../routing/useBasePath";
|
|
22
22
|
import { style } from "./Summary.style";
|
|
@@ -25,9 +25,9 @@ const Summary = ({ layout: Layout, children }) => {
|
|
|
25
25
|
const { customer: { customerId, country, segment }, } = useStaticInfo();
|
|
26
26
|
const [pricingCollapsed, setPricingCollapsed] = useState(true);
|
|
27
27
|
const [pricingHeight, setPricingHeight] = useState(0);
|
|
28
|
-
const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
|
|
29
|
-
const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
|
|
30
|
-
const submitButtonText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
28
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_TITLE });
|
|
29
|
+
const descriptionText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_DESCRIPTION });
|
|
30
|
+
const submitButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
31
31
|
const { screen } = useDevice();
|
|
32
32
|
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
33
33
|
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
|
package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js
CHANGED
|
@@ -4,13 +4,14 @@ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-na
|
|
|
4
4
|
import { Button, Icon, Text } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
7
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
8
8
|
import { Pricing } from "../pricing/Pricing";
|
|
9
9
|
import { style } from "./CollapsiblePricing.style";
|
|
10
10
|
const CollapsiblePricing = ({ pricing, totalCheckoutItemsKept, collapsible = true, collapsed = false, submitButtonText, onPress = () => void 0, onSubmit, }) => {
|
|
11
11
|
const { pendingToPay } = pricing;
|
|
12
|
-
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL });
|
|
12
|
+
const totalText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_TOTAL });
|
|
13
13
|
const totalCheckoutItemsKeptText = useI18nMessage({
|
|
14
|
+
domain: DOMAIN,
|
|
14
15
|
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
15
16
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
16
17
|
});
|
|
@@ -3,26 +3,28 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
6
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
6
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./Pricing.style";
|
|
8
8
|
const Row = ({ action = false, text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
9
9
|
React.createElement(Text, { action: action, level: level }, text),
|
|
10
10
|
children));
|
|
11
11
|
const Pricing = ({ pricing, totalCheckoutItemsKept }) => {
|
|
12
12
|
const { pendingToPay, subtotal, balanceDiscount, discount, discountPercentage = 0, service } = pricing;
|
|
13
|
-
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL });
|
|
13
|
+
const totalText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_TOTAL });
|
|
14
14
|
const totalCheckoutItemsKeptText = useI18nMessage({
|
|
15
|
+
domain: DOMAIN,
|
|
15
16
|
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
16
17
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
17
18
|
});
|
|
18
|
-
const subtotalText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
19
|
-
const freeText = useI18nMessage({ id: I18nMessages.SUMMARY_FREE });
|
|
19
|
+
const subtotalText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
20
|
+
const freeText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_FREE });
|
|
20
21
|
const discountText = useI18nMessage({
|
|
22
|
+
domain: DOMAIN,
|
|
21
23
|
id: I18nMessages.SUMMARY_DISCOUNT,
|
|
22
24
|
values: { discount: discountPercentage?.toString() },
|
|
23
25
|
});
|
|
24
|
-
const creditText = useI18nMessage({ id: I18nMessages.SUMMARY_CREDIT });
|
|
25
|
-
const feeText = useI18nMessage({ id: I18nMessages.SUMMARY_FEE });
|
|
26
|
+
const creditText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_CREDIT });
|
|
27
|
+
const feeText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_FEE });
|
|
26
28
|
return (React.createElement(View, null,
|
|
27
29
|
React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
|
|
28
30
|
React.createElement(Price, { price: subtotal, variant: "subtotal" })),
|
|
@@ -4,17 +4,17 @@ import { Text, useDevice } from "@lookiero/aurora";
|
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Tabs } 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 { ProductVariant } from "../../../shared/components/productVariant/ProductVariant";
|
|
9
9
|
import { style } from "./CheckoutItemsTabs.style";
|
|
10
10
|
const CheckoutItem = ({ checkoutItemStatus, checkoutItemProductVariant, checkoutItemPrice, country, testID, style: customStyle, onPress, }) => (React.createElement(View, { testID: testID },
|
|
11
11
|
React.createElement(ProductVariant, { brand: checkoutItemProductVariant.brand, color: checkoutItemProductVariant.color, country: country, media: checkoutItemProductVariant.media, name: checkoutItemProductVariant.name, price: checkoutItemPrice, size: checkoutItemProductVariant.size, status: checkoutItemStatus, style: customStyle, onPress: onPress })));
|
|
12
12
|
const CheckoutItemsTabs = ({ tabIndex, checkoutItemsKept, checkoutItemsReturned, country, onPressItem, onChanged, }) => {
|
|
13
13
|
const { screen } = useDevice();
|
|
14
|
-
const keepTabText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_TAB });
|
|
15
|
-
const returnTabText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_TAB });
|
|
16
|
-
const keepEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_EMPTY });
|
|
17
|
-
const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
|
|
14
|
+
const keepTabText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_KEEP_TAB });
|
|
15
|
+
const returnTabText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_RETURN_TAB });
|
|
16
|
+
const keepEmptyText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_KEEP_EMPTY });
|
|
17
|
+
const returnEmptyText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_RETURN_EMPTY });
|
|
18
18
|
const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
|
|
19
19
|
const data = useMemo(() => [{ id: "0" }, { id: "1" }], []);
|
|
20
20
|
const renderItem = useCallback(({ index }) => index === 0 ? (checkoutItemsKept.length === 0 ? (React.createElement(Text, { style: style.emptyText }, keepEmptyText)) : (React.createElement(React.Fragment, null, checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, country: country, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "9.
|
|
1
|
+
export declare const VERSION = "9.14.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "9.
|
|
1
|
+
export const VERSION = "9.14.0";
|
package/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { CheckoutStatus } from "./src/domain/checkout/model/checkout";
|
|
|
9
9
|
import { KameleoonEnvironment } from "./src/infrastructure/ab-testing/kameleoonEnvironment";
|
|
10
10
|
import { bootstrap as checkoutBootstrap } from "./src/infrastructure/delivery/bootstrap";
|
|
11
11
|
import { root, RootProps } from "./src/infrastructure/ui/Root";
|
|
12
|
+
import { DOMAIN } from "./src/infrastructure/ui/i18n/i18n";
|
|
12
13
|
import { CheckoutProjection } from "./src/projection/checkout/checkout";
|
|
13
14
|
import { viewFirstAvailableCheckoutByCustomerId } from "./src/projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
14
15
|
import { Customer } from "./src/projection/customer/customer";
|
|
@@ -44,7 +45,7 @@ const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken, translations, sent
|
|
|
44
45
|
const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
|
|
45
46
|
const I18n = i18n({
|
|
46
47
|
fetchTranslation: fetchTranslations({ translations }),
|
|
47
|
-
domain:
|
|
48
|
+
domain: DOMAIN,
|
|
48
49
|
});
|
|
49
50
|
|
|
50
51
|
const firstAvailableCheckoutByCustomerId: FirstAvailableCheckoutByCustomerIdFunction = ({ customerId }) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.14.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@lookiero/sty-psp-ab-testing": "^0.3",
|
|
25
25
|
"@lookiero/sty-psp-expo-config": "^0.2",
|
|
26
26
|
"@lookiero/sty-psp-http": "^2.0",
|
|
27
|
-
"@lookiero/sty-psp-i18n": "^0.
|
|
27
|
+
"@lookiero/sty-psp-i18n": "^0.4",
|
|
28
28
|
"@lookiero/sty-psp-locale": "^0.4",
|
|
29
29
|
"@lookiero/sty-psp-logging": "^0.5",
|
|
30
|
-
"@lookiero/sty-psp-notifications": "^0.
|
|
30
|
+
"@lookiero/sty-psp-notifications": "^0.8",
|
|
31
31
|
"@lookiero/sty-psp-react-native": "^0.3",
|
|
32
32
|
"@lookiero/sty-psp-segment": "^0.1",
|
|
33
33
|
"@lookiero/sty-psp-storage": "^0.2",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"@lookiero/sty-psp-ui-settings": "^0.2",
|
|
37
37
|
"@lookiero/sty-psp-units": "^0.1",
|
|
38
38
|
"@lookiero/sty-psp-uuid": "^0.2",
|
|
39
|
-
"@react-native-async-storage/async-storage": "1.23.1",
|
|
40
39
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
41
40
|
"react-native-svg": "15.2.0",
|
|
42
41
|
"tiny-invariant": "^1.3.1"
|
|
@@ -51,6 +50,7 @@
|
|
|
51
50
|
"@lookiero/sty-psp-prettier-config": "*",
|
|
52
51
|
"@lookiero/sty-psp-scripts": "*",
|
|
53
52
|
"@lookiero/sty-psp-typescript": "*",
|
|
53
|
+
"@react-native-async-storage/async-storage": "1.23.1",
|
|
54
54
|
"@remix-run/router": ">=1.10",
|
|
55
55
|
"@testing-library/react-native": ">=12",
|
|
56
56
|
"@types/jest-when": ">=3",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"expo-crypto": "~13.0.2",
|
|
62
62
|
"jest-mock-extended": ">=3",
|
|
63
63
|
"jest-when": ">=3",
|
|
64
|
-
"react-intl": "^6.5.1",
|
|
65
64
|
"react-native-gesture-handler": "~2.16.1",
|
|
66
65
|
"react-native-get-random-values": "~1.11.0",
|
|
67
66
|
"react-native-reanimated": "~3.10.1",
|
|
@@ -74,14 +73,15 @@
|
|
|
74
73
|
"@lookiero/aurora-fonts": ">=2",
|
|
75
74
|
"@lookiero/aurora-iconfont": ">=3",
|
|
76
75
|
"@lookiero/event": "^0.3",
|
|
77
|
-
"@lookiero/i18n": ">=
|
|
78
|
-
"@lookiero/i18n-react": ">=
|
|
76
|
+
"@lookiero/i18n": ">=2",
|
|
77
|
+
"@lookiero/i18n-react": ">=2",
|
|
79
78
|
"@lookiero/payments-front": "6.0.3",
|
|
80
79
|
"apollo-boost": "0.4.4",
|
|
81
80
|
"expo": ">=51",
|
|
82
81
|
"expo-font": ">=12",
|
|
83
82
|
"react": ">=18",
|
|
84
83
|
"react-native": ">=0.74",
|
|
84
|
+
"react-native-gesture-handler": "~2.16.1",
|
|
85
85
|
"react-native-get-random-values": ">=1.11",
|
|
86
86
|
"react-native-reanimated": "~3.10.1",
|
|
87
87
|
"react-native-safe-area-context": ">=4.10",
|
package/src/Expo.tsx
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
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";
|
|
4
5
|
|
|
6
|
+
enableLegacyWebImplementation(true);
|
|
7
|
+
|
|
5
8
|
registerRootComponent(ExpoRoot);
|
package/src/ExpoRoot.tsx
CHANGED
|
@@ -17,13 +17,14 @@ import { KameleoonEnvironment } from "./infrastructure/ab-testing/kameleoonEnvir
|
|
|
17
17
|
import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
|
|
18
18
|
import { bootstrap as checkoutMockBootstrap } from "./infrastructure/delivery/bootstrap.mock";
|
|
19
19
|
import { root } from "./infrastructure/ui/Root";
|
|
20
|
+
import { DOMAIN } from "./infrastructure/ui/i18n/i18n";
|
|
20
21
|
import { Router } from "./infrastructure/ui/routing/router/Router";
|
|
21
22
|
import { Customer } from "./projection/customer/customer";
|
|
22
23
|
import { Order } from "./projection/order/order";
|
|
23
24
|
import { Subscription } from "./projection/subscription/subscription";
|
|
24
25
|
import { VERSION } from "./version";
|
|
25
26
|
|
|
26
|
-
const locale: Locale = Locale.
|
|
27
|
+
const locale: Locale = Locale.en_GB;
|
|
27
28
|
const subscription: Subscription = "b";
|
|
28
29
|
const order: Order = {
|
|
29
30
|
isFirstOrder: false,
|
|
@@ -32,7 +33,7 @@ const order: Order = {
|
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const customer: Customer = {
|
|
35
|
-
customerId: "
|
|
36
|
+
customerId: "a4355713-469b-4684-bf90-3215702dfb1c",
|
|
36
37
|
country: Country.ES,
|
|
37
38
|
segment: Segment.WOMEN,
|
|
38
39
|
};
|
|
@@ -51,7 +52,7 @@ const apiUrl =
|
|
|
51
52
|
? "/local-to-dev"
|
|
52
53
|
: "/checkout/api";
|
|
53
54
|
const authToken =
|
|
54
|
-
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
55
|
+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2ODkxMDAsImV4cCI6MTc0NjI3ODQwMiwiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjUtMDQtMDMiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiYTQzNTU3MTMtNDY5Yi00Njg0LWJmOTAtMzIxNTcwMmRmYjFjIiwiaWF0IjoxNzQzNjg2NDAyfQ.pmqFo-4s0USFpzCnijRt78bWuBdu2Q7f4L9UtOkfAwo";
|
|
55
56
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
56
57
|
|
|
57
58
|
const externalTranslationsUrl =
|
|
@@ -64,7 +65,7 @@ const translations: EndpointFunction[] = [
|
|
|
64
65
|
(locale) =>
|
|
65
66
|
translationExternalEndpoint({
|
|
66
67
|
translationsUrl: externalTranslationsUrl,
|
|
67
|
-
projects: [["
|
|
68
|
+
projects: [["checkout"]],
|
|
68
69
|
})(locale),
|
|
69
70
|
];
|
|
70
71
|
|
|
@@ -105,7 +106,7 @@ const { Component: Messaging, queryBus } =
|
|
|
105
106
|
: checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
|
|
106
107
|
const I18n = i18n({
|
|
107
108
|
fetchTranslation: fetchTranslations({ translations }),
|
|
108
|
-
domain:
|
|
109
|
+
domain: DOMAIN,
|
|
109
110
|
});
|
|
110
111
|
const Root = root({
|
|
111
112
|
Messaging,
|
package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC } 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
|
|
|
7
7
|
interface FiveItemsDiscountBannerProps {
|
|
@@ -9,10 +9,11 @@ interface FiveItemsDiscountBannerProps {
|
|
|
9
9
|
}
|
|
10
10
|
const FiveItemsDiscountBanner: FC<FiveItemsDiscountBannerProps> = ({ fiveItemsDiscount }) => {
|
|
11
11
|
const bannerText = useI18nMessage({
|
|
12
|
+
domain: DOMAIN,
|
|
12
13
|
id: I18nMessages.BANNER_DISCOUNT_TEXT,
|
|
13
14
|
values: {
|
|
14
15
|
discount: fiveItemsDiscount.toString(),
|
|
15
|
-
b: (chunks) => (
|
|
16
|
+
b: (chunks: string[]) => (
|
|
16
17
|
<Text as="span" display={DISPLAY.INLINE} level={2} style={style.textBold}>
|
|
17
18
|
{chunks}
|
|
18
19
|
</Text>
|
|
@@ -3,6 +3,7 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nNumber } from "@lookiero/i18n-react";
|
|
5
5
|
import { PriceProjection } from "../../../../../projection/price/price";
|
|
6
|
+
import { DOMAIN } from "../../../i18n/i18n";
|
|
6
7
|
import { style } from "./Price.style";
|
|
7
8
|
|
|
8
9
|
type PriceVariant = "default" | "detail" | "subtotal" | "total";
|
|
@@ -29,11 +30,13 @@ interface PriceProps {
|
|
|
29
30
|
const Price: FC<PriceProps> = ({ price, variant = "default", withPercentage = false }) => {
|
|
30
31
|
const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
|
|
31
32
|
const productPrice = useI18nNumber({
|
|
33
|
+
domain: DOMAIN,
|
|
32
34
|
value: price.amount / 100,
|
|
33
35
|
style: "currency",
|
|
34
36
|
currency: price.currency,
|
|
35
37
|
});
|
|
36
38
|
const productDiscountedPrice = useI18nNumber({
|
|
39
|
+
domain: DOMAIN,
|
|
37
40
|
value: (price.discountedPrice?.amount || 0) / 100,
|
|
38
41
|
style: "currency",
|
|
39
42
|
currency: price.currency,
|
|
@@ -2,6 +2,7 @@ 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 { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
7
8
|
import { style } from "./ButtonCheckoutQuestionItem.style";
|
|
@@ -15,7 +16,7 @@ const ButtonCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
15
16
|
}: CheckoutQuestionItemProps) => {
|
|
16
17
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
17
18
|
|
|
18
|
-
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
19
|
+
const optionText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
19
20
|
const handleOnPress = useCallback(
|
|
20
21
|
() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }),
|
|
21
22
|
[onChange, checkoutQuestion.id, checkoutQuestionParentId],
|
|
@@ -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 { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
6
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
6
7
|
import { style } from "./HostDefaultCheckoutQuestionItem.style";
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ const HostDefaultCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
9
10
|
checkoutQuestion,
|
|
10
11
|
children,
|
|
11
12
|
}: CheckoutQuestionItemProps) => {
|
|
12
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
13
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<>
|
|
@@ -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 { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
6
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
6
7
|
import { style } from "./HostSelectCheckoutQuestionItem.style";
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ const HostSelectCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
9
10
|
checkoutQuestion,
|
|
10
11
|
children,
|
|
11
12
|
}: CheckoutQuestionItemProps) => {
|
|
12
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
13
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<>
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
6
7
|
import { style } from "./TextareaCheckoutQuestionItem.style";
|
|
@@ -10,7 +11,7 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
10
11
|
checkoutQuestionParentId,
|
|
11
12
|
testID,
|
|
12
13
|
}: CheckoutQuestionItemProps) => {
|
|
13
|
-
const { formatMessage } =
|
|
14
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
14
15
|
const placeholderText = useMemo(
|
|
15
16
|
() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""),
|
|
16
17
|
[formatMessage, checkoutQuestion.placeholder],
|
|
@@ -1,10 +1,10 @@
|
|
|
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 { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
6
|
import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
7
|
-
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
7
|
+
import { DOMAIN, I18nMessages } from "../../../../../i18n/i18n";
|
|
8
8
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
9
9
|
import { style } from "./HostDefaultReturnQuestionItem.style";
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ const HostDefaultReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_
|
|
|
12
12
|
returnQuestion,
|
|
13
13
|
children,
|
|
14
14
|
}) => {
|
|
15
|
-
const { formatMessage } =
|
|
15
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
16
16
|
const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
|
|
17
17
|
|
|
18
18
|
return (
|
|
@@ -2,8 +2,9 @@
|
|
|
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
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
8
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
8
9
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
9
10
|
|
|
@@ -12,7 +13,7 @@ const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HO
|
|
|
12
13
|
children,
|
|
13
14
|
testID,
|
|
14
15
|
}) => {
|
|
15
|
-
const { formatMessage } =
|
|
16
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
16
17
|
const placeholderText = useMemo(
|
|
17
18
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
18
19
|
[formatMessage, returnQuestion.metadata.placeholder],
|
|
@@ -2,9 +2,10 @@
|
|
|
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
7
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
8
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
8
9
|
import {
|
|
9
10
|
useReturnQuestionFeedback,
|
|
10
11
|
useReturnQuestionFeedbackForReturnQuestion,
|
|
@@ -22,7 +23,7 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_S
|
|
|
22
23
|
portalHostName,
|
|
23
24
|
testID,
|
|
24
25
|
}) => {
|
|
25
|
-
const { formatMessage } =
|
|
26
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
26
27
|
const placeholderText = useMemo(
|
|
27
28
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
28
29
|
[formatMessage, returnQuestion.metadata.placeholder],
|
|
@@ -34,10 +35,9 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_S
|
|
|
34
35
|
|
|
35
36
|
const feedback = useReturnQuestionFeedback();
|
|
36
37
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
37
|
-
const intl = useIntl();
|
|
38
38
|
const translate = useCallback(
|
|
39
|
-
(returnQuestionName: string) =>
|
|
40
|
-
[
|
|
39
|
+
(returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
40
|
+
[formatMessage],
|
|
41
41
|
);
|
|
42
42
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
43
43
|
|
|
@@ -3,9 +3,10 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { LayoutChangeEvent, 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 { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
8
8
|
import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
9
|
+
import { DOMAIN } from "../../../../../../i18n/i18n";
|
|
9
10
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
10
11
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
11
12
|
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
@@ -16,7 +17,7 @@ const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_ST
|
|
|
16
17
|
children,
|
|
17
18
|
portalHostName,
|
|
18
19
|
}) => {
|
|
19
|
-
const { formatMessage } =
|
|
20
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
20
21
|
const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
21
22
|
const feedbackReturnQuestion = feedback
|
|
22
23
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
@@ -1,10 +1,11 @@
|
|
|
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 { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
7
7
|
import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
8
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
8
9
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
9
10
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
10
11
|
|
|
@@ -22,7 +23,7 @@ const ModalOptionReturnQuestionItems = ({
|
|
|
22
23
|
visible,
|
|
23
24
|
onClose,
|
|
24
25
|
}: ModalOptionReturnQuestionItemsProps) => {
|
|
25
|
-
const { formatMessage } =
|
|
26
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
26
27
|
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
27
28
|
|
|
28
29
|
return (
|