@lookiero/checkout 3.9.0-beta.1 → 3.9.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/infrastructure/domain/checkout/react/useStartCheckout.js +1 -1
- package/dist/infrastructure/projection/checkout/checkout.js +0 -14
- package/dist/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +5 -7
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +1 -1
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.d.ts +1 -0
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +3 -3
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +1 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/templates/header/Header.style.d.ts +0 -1
- package/dist/infrastructure/ui/components/templates/header/Header.style.js +1 -3
- package/dist/infrastructure/ui/hooks/useSubmitCheckout.js +0 -5
- package/dist/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +1 -1
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +6 -4
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +10 -3
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +10 -3
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -3
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.d.ts +3 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.js +6 -3
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +1 -2
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +3 -4
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +19 -16
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.js +1 -4
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +1 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +1 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +3 -2
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +3 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +3 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -3
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +10 -3
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +10 -3
- package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +5 -5
- package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.d.ts +4 -0
- package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.js +4 -0
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +8 -7
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +6 -0
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +6 -0
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +4 -3
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.d.ts +10 -3
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.js +10 -3
- package/dist/shared/ui/components/atoms/input/Input.js +2 -2
- package/dist/shared/ui/components/layouts/modal/Modal.js +1 -1
- package/dist/shared/ui/components/layouts/slider/Slider.d.ts +5 -0
- package/dist/shared/ui/components/layouts/slider/Slider.js +4 -4
- package/dist/shared/ui/components/layouts/sticky/Sticky.js +3 -1
- package/dist/shared/ui/components/layouts/sticky/Sticky.style.d.ts +0 -3
- package/dist/shared/ui/components/layouts/sticky/Sticky.style.js +2 -3
- package/dist/shared/ui/components/molecules/selectField/SelectField.js +3 -3
- package/package.json +4 -10
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.d.ts +0 -15
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.js +0 -14
- package/dist/shared/ui/components/layouts/carousel/Carousel.d.ts +0 -11
- package/dist/shared/ui/components/layouts/carousel/Carousel.js +0 -31
- package/dist/shared/ui/components/layouts/carousel/Carousel.style.d.ts +0 -24
- package/dist/shared/ui/components/layouts/carousel/Carousel.style.js +0 -25
- package/dist/shared/ui/components/layouts/carousel/Carousel2.d.ts +0 -30
- package/dist/shared/ui/components/layouts/carousel/Carousel2.js +0 -79
- package/dist/shared/ui/components/layouts/carousel/DragComponent.d.ts +0 -3
- package/dist/shared/ui/components/layouts/carousel/DragComponent.js +0 -48
- package/dist/shared/ui/components/layouts/slider/Bullets.d.ts +0 -10
- package/dist/shared/ui/components/layouts/slider/Bullets.js +0 -28
- package/dist/shared/ui/components/layouts/slider/Bullets.style.d.ts +0 -12
- package/dist/shared/ui/components/layouts/slider/Bullets.style.js +0 -15
- package/dist/shared/ui/components/layouts/slider/Bullets2.d.ts +0 -10
- package/dist/shared/ui/components/layouts/slider/Bullets2.js +0 -30
- package/dist/shared/ui/components/layouts/slider/SliderDots.d.ts +0 -8
- package/dist/shared/ui/components/layouts/slider/SliderDots.js +0 -16
- package/dist/shared/ui/components/layouts/slider/SliderDots.style.d.ts +0 -12
- package/dist/shared/ui/components/layouts/slider/SliderDots.style.js +0 -15
|
@@ -11,7 +11,7 @@ const useStartCheckout = ({ checkoutId, logger }) => {
|
|
|
11
11
|
await commandBus(startCheckout({ aggregateId: checkoutId }));
|
|
12
12
|
}
|
|
13
13
|
catch (error) {
|
|
14
|
-
if (!error?.message?.includes("
|
|
14
|
+
if (!error?.message?.includes("Invariant failed")) {
|
|
15
15
|
logger.captureException(error);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
const toCheckoutProjection = (checkoutDto) => ({
|
|
2
2
|
...checkoutDto,
|
|
3
|
-
items: checkoutDto.items.map((item) => ({
|
|
4
|
-
...item,
|
|
5
|
-
productVariant: {
|
|
6
|
-
...item.productVariant,
|
|
7
|
-
media: [
|
|
8
|
-
...item.productVariant.media,
|
|
9
|
-
...item.productVariant.media,
|
|
10
|
-
...item.productVariant.media,
|
|
11
|
-
...item.productVariant.media,
|
|
12
|
-
...item.productVariant.media,
|
|
13
|
-
...item.productVariant.media,
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
})),
|
|
17
3
|
expiresOn: new Date(checkoutDto.expiresOn),
|
|
18
4
|
});
|
|
19
5
|
export { toCheckoutProjection };
|
package/dist/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js
CHANGED
|
@@ -13,6 +13,6 @@ const useViewPaymentFlowPayloadByCheckoutId = ({ checkoutId }) => useQuery({
|
|
|
13
13
|
query: viewPaymentFlowPayloadByCheckoutId({ checkoutId: checkoutId }),
|
|
14
14
|
contextId: MESSAGING_CONTEXT_ID,
|
|
15
15
|
invalidation: shouldInvalidate,
|
|
16
|
-
options: { refetchOnMount: "always", enabled: Boolean(checkoutId) },
|
|
16
|
+
options: { refetchOnMount: "always", enabled: Boolean(checkoutId), cacheTime: 0 },
|
|
17
17
|
});
|
|
18
18
|
export { useViewPaymentFlowPayloadByCheckoutId };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { View } from "react-native";
|
|
4
|
-
import { GestureHandlerRootView, ScrollView as RNGHScrollView } from "react-native-gesture-handler";
|
|
3
|
+
import { ScrollView, View } from "react-native";
|
|
5
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
5
|
import { Footer as DefaultFooter } from "../../../templates/footer/Footer";
|
|
7
6
|
import { DefaultHeader } from "../../../templates/header/defaultHeader/DefaultHeader";
|
|
@@ -9,10 +8,9 @@ import { Footer } from "../components/footer/Footer";
|
|
|
9
8
|
import { Header } from "../components/header/Header";
|
|
10
9
|
import { style } from "./DummyLayout.style";
|
|
11
10
|
const DummyLayout = ({ children, header = React.createElement(DefaultHeader, null), footer = React.createElement(DefaultFooter, null), panel, style: customStyle, scrollEnabled, onLayout, }) => (React.createElement(SafeAreaView, { style: [style.safeAreaView, customStyle?.safeAreaView] },
|
|
12
|
-
React.createElement(
|
|
13
|
-
React.createElement(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
React.createElement(View, { style: style.children, onLayout: onLayout }, children))),
|
|
11
|
+
React.createElement(ScrollView, { contentContainerStyle: [style.scrollView, customStyle?.scrollView], scrollEnabled: scrollEnabled, scrollEventThrottle: 16, showsVerticalScrollIndicator: false, stickyHeaderIndices: [0] },
|
|
12
|
+
React.createElement(Header, null, header),
|
|
13
|
+
panel,
|
|
14
|
+
React.createElement(View, { style: style.children, onLayout: onLayout }, children)),
|
|
17
15
|
React.createElement(Footer, null, footer)));
|
|
18
16
|
export { DummyLayout };
|
|
@@ -2,7 +2,7 @@ import React, { memo } from "react";
|
|
|
2
2
|
import { useCheckoutQuestionItem } from "./behaviors/useCheckoutQuestionItem";
|
|
3
3
|
const CheckoutQuestion = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
4
4
|
const Item = useCheckoutQuestionItem({ type: checkoutQuestion.type });
|
|
5
|
-
return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId },
|
|
5
|
+
return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId, testID: checkoutQuestion.id },
|
|
6
6
|
React.createElement(React.Fragment, null, checkoutQuestion.children?.map((childCheckoutQuestion) => (React.createElement(CheckoutQuestion, { key: childCheckoutQuestion.id, checkoutQuestion: childCheckoutQuestion, checkoutQuestionParentId: checkoutQuestion.id }))))));
|
|
7
7
|
};
|
|
8
8
|
export default memo(CheckoutQuestion);
|
|
@@ -5,6 +5,7 @@ interface CheckoutQuestionItemProps {
|
|
|
5
5
|
readonly checkoutQuestionParentId: string;
|
|
6
6
|
readonly children?: ReactNode;
|
|
7
7
|
readonly portalHostName?: string;
|
|
8
|
+
readonly testID?: string;
|
|
8
9
|
}
|
|
9
10
|
type CheckoutQuestionItem = FC<CheckoutQuestionItemProps>;
|
|
10
11
|
export type { CheckoutQuestionItem, CheckoutQuestionItemProps };
|
|
@@ -5,10 +5,10 @@ import { theme } from "../../../../../theme/theme";
|
|
|
5
5
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
6
6
|
import { style } from "./ButtonCheckoutQuestionItem.style";
|
|
7
7
|
const { colorAccent, colorBase } = theme();
|
|
8
|
-
const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
8
|
+
const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
|
|
9
9
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
10
10
|
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
11
11
|
const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
|
|
12
|
-
return (React.createElement(Button, { style: [style.button, { backgroundColor: feedback === checkoutQuestion.id ? colorAccent : colorBase }], variant: BUTTON_VARIANT.SECONDARY, onPress: handleOnPress }, optionText));
|
|
12
|
+
return (React.createElement(Button, { accessibilityLabel: testID, style: [style.button, { backgroundColor: feedback === checkoutQuestion.id ? colorAccent : colorBase }], testID: testID, variant: BUTTON_VARIANT.SECONDARY, onPress: handleOnPress }, optionText));
|
|
13
13
|
};
|
|
14
14
|
export { ButtonCheckoutQuestionItem };
|
|
@@ -16,12 +16,12 @@ const ICON = {
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
17
|
"checkout_question.icon.good": Happy,
|
|
18
18
|
};
|
|
19
|
-
const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
19
|
+
const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
|
|
20
20
|
const Icon = ICON[checkoutQuestion.name];
|
|
21
21
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
22
22
|
const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
|
|
23
23
|
invariant(Icon, "CheckoutQuestion icon does not exist");
|
|
24
|
-
return (React.createElement(Pressable, { onPress: handleOnPress },
|
|
25
|
-
React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon
|
|
24
|
+
return (React.createElement(Pressable, { accessibilityLabel: testID, testID: testID, onPress: handleOnPress },
|
|
25
|
+
React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon })));
|
|
26
26
|
};
|
|
27
27
|
export { IconCheckoutQuestionItem };
|
|
@@ -3,11 +3,11 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
4
4
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
5
5
|
const TEXTAREA_MIN_HEIGHT = 96;
|
|
6
|
-
const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
6
|
+
const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
|
|
7
7
|
const { formatMessage } = useIntl();
|
|
8
8
|
const placeholderText = useMemo(() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""), [formatMessage, checkoutQuestion.placeholder]);
|
|
9
9
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
10
10
|
const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
|
|
11
|
-
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, testID: testID, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
12
12
|
};
|
|
13
13
|
export { TextareaCheckoutQuestionItem };
|
|
@@ -2,7 +2,7 @@ import React, { memo } from "react";
|
|
|
2
2
|
import { useReturnQuestionItem } from "./behaviors/useReturnQuestionItem";
|
|
3
3
|
const ReturnQuestion = ({ returnQuestion, returnQuestionParentId, portalHostName, }) => {
|
|
4
4
|
const Item = useReturnQuestionItem({ type: returnQuestion.type });
|
|
5
|
-
return (React.createElement(Item, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId },
|
|
5
|
+
return (React.createElement(Item, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId, testID: returnQuestion.id },
|
|
6
6
|
React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParentId: returnQuestion.id }))))));
|
|
7
7
|
};
|
|
8
8
|
export default memo(ReturnQuestion);
|
|
@@ -5,6 +5,7 @@ interface ReturnQuestionItemProps {
|
|
|
5
5
|
readonly returnQuestionParentId: string;
|
|
6
6
|
readonly children?: ReactNode;
|
|
7
7
|
readonly portalHostName?: string;
|
|
8
|
+
readonly testID?: string;
|
|
8
9
|
}
|
|
9
10
|
type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
|
|
10
11
|
export type { ReturnQuestionItem, ReturnQuestionItemProps };
|
|
@@ -7,7 +7,7 @@ import { InputField } from "../../../../../../../shared/ui/components/molecules/
|
|
|
7
7
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
8
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
9
9
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
10
|
-
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
10
|
+
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, testID, }) => {
|
|
11
11
|
const { formatMessage } = useIntl();
|
|
12
12
|
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
13
13
|
const [modalVisible, setModalVisible] = useState(false);
|
|
@@ -31,7 +31,7 @@ const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName
|
|
|
31
31
|
// deepestReturnQuestionWithFeedback needs to be as a dependency in order to be re-evaluated whenever it changes
|
|
32
32
|
}, [handleOnModalClose, deepestReturnQuestionWithFeedback, isLeaf]);
|
|
33
33
|
return (React.createElement(React.Fragment, null,
|
|
34
|
-
React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
34
|
+
React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: style.container, testID: testID, underlayColor: containerUnderlayColor, accessible: true, onPress: handleOnPress },
|
|
35
35
|
React.createElement(View, { pointerEvents: "none" },
|
|
36
36
|
React.createElement(InputField, { editable: false, icon: "arrow-down", label: placeholderText, value: inputValue }))),
|
|
37
37
|
React.createElement(Modal, { portalHostName: portalHostName, visible: modalVisible, header: deepestReturnQuestionWithFeedback && (React.createElement(ButtonIcon, { name: "arrow-left", testID: "modal-back-button", onPress: handleOnBackButtonPress })), scroll: true, showCloseButton: true, onClose: handleOnModalClose },
|
|
@@ -4,11 +4,11 @@ import React, { useCallback } from "react";
|
|
|
4
4
|
import { TouchableHighlight } from "react-native";
|
|
5
5
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
6
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
7
|
-
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
|
|
7
|
+
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, testID, }) => {
|
|
8
8
|
const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
|
|
9
9
|
const optionText = useI18nMessage({ id: returnQuestion.name });
|
|
10
10
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParentId]);
|
|
11
|
-
return (React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
11
|
+
return (React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: style.container, testID: testID, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
12
12
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
13
13
|
};
|
|
14
14
|
export { OptionReturnQuestionItem };
|
|
@@ -3,11 +3,11 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
4
4
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
5
5
|
const TEXTAREA_MIN_HEIGHT = 96;
|
|
6
|
-
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
|
|
6
|
+
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, testID, }) => {
|
|
7
7
|
const { formatMessage } = useIntl();
|
|
8
8
|
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
9
9
|
const { feedback, onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
|
|
10
10
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: value }), [onChange, returnQuestionParentId]);
|
|
11
|
-
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, testID: testID, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
12
12
|
};
|
|
13
13
|
export { TextareaReturnQuestionItem };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../theme/theme";
|
|
3
|
-
const { colorBase, spaceS
|
|
4
|
-
const HEADER_HEIGHT = spaceXXXL;
|
|
3
|
+
const { colorBase, spaceS } = theme();
|
|
5
4
|
const style = StyleSheet.create({
|
|
6
5
|
header: {
|
|
7
6
|
alignItems: "center",
|
|
@@ -9,7 +8,6 @@ const style = StyleSheet.create({
|
|
|
9
8
|
flexDirection: "row",
|
|
10
9
|
flexGrow: 0,
|
|
11
10
|
flexWrap: "nowrap",
|
|
12
|
-
height: HEADER_HEIGHT,
|
|
13
11
|
justifyContent: "space-between",
|
|
14
12
|
overflow: "visible",
|
|
15
13
|
paddingHorizontal: spaceS,
|
|
@@ -19,11 +19,6 @@ const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onEr
|
|
|
19
19
|
catch (error) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* paymentFlowRef.current is not properly set between render-cycles,
|
|
24
|
-
* so we have to defer the startLegacyBoxCheckout invocation.
|
|
25
|
-
*/
|
|
26
|
-
await new Promise((resolve) => setTimeout(() => resolve(0), 200));
|
|
27
22
|
paymentFlowRef.current?.startLegacyBoxCheckout(
|
|
28
23
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29
24
|
// @ts-ignore
|
|
@@ -32,6 +32,6 @@ const CheckoutQuestionsForm = ({ checkoutQuestions, submitButtonDisabled, onSubm
|
|
|
32
32
|
return (React.createElement(React.Fragment, null,
|
|
33
33
|
React.createElement(CheckoutQuestionItemProvider, { checkoutQuestionItems: checkoutQuestionItems },
|
|
34
34
|
React.createElement(CheckoutQuestions, { checkoutQuestions: filteredCheckoutQuestions })),
|
|
35
|
-
React.createElement(Button, { busy: submitButtonDisabled, style: style.button, onPress: handlePress }, buttonText)));
|
|
35
|
+
React.createElement(Button, { busy: submitButtonDisabled, style: style.button, testID: "checkout-feedback-button", onPress: handlePress }, buttonText)));
|
|
36
36
|
};
|
|
37
37
|
export { CheckoutQuestionsForm };
|
package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js
CHANGED
|
@@ -12,9 +12,11 @@ const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
|
|
|
12
12
|
const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
|
|
13
13
|
return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
|
|
14
14
|
React.createElement(View, { style: style.modal },
|
|
15
|
-
React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
|
|
16
|
-
React.createElement(Text, { level: 3, style: style.
|
|
17
|
-
React.createElement(Button, { style: style.button, onPress: onDismiss },
|
|
18
|
-
|
|
15
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
|
|
16
|
+
React.createElement(Text, { level: 3, style: style.description }, descriptionText),
|
|
17
|
+
React.createElement(Button, { style: style.button, onPress: onDismiss },
|
|
18
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, dismissButtonText)),
|
|
19
|
+
React.createElement(Button, { style: [style.button, style.confirmButton], variant: BUTTON_VARIANT.SECONDARY, onPress: onConfirm },
|
|
20
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, confirmButtonText)))));
|
|
19
21
|
};
|
|
20
22
|
export { GetOutOfCheckoutModal };
|
|
@@ -2,15 +2,22 @@ declare const style: {
|
|
|
2
2
|
button: {
|
|
3
3
|
flex: number;
|
|
4
4
|
};
|
|
5
|
+
buttonText: {
|
|
6
|
+
width: string;
|
|
7
|
+
};
|
|
5
8
|
confirmButton: {
|
|
6
9
|
marginTop: number;
|
|
7
10
|
};
|
|
11
|
+
description: {
|
|
12
|
+
marginVertical: number;
|
|
13
|
+
textAlign: "center";
|
|
14
|
+
width: string;
|
|
15
|
+
};
|
|
8
16
|
modal: {
|
|
9
17
|
padding: number;
|
|
10
18
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
textAlign: "center";
|
|
19
|
+
title: {
|
|
20
|
+
width: string;
|
|
14
21
|
};
|
|
15
22
|
};
|
|
16
23
|
export { style };
|
|
@@ -5,15 +5,22 @@ const style = StyleSheet.create({
|
|
|
5
5
|
button: {
|
|
6
6
|
flex: 0,
|
|
7
7
|
},
|
|
8
|
+
buttonText: {
|
|
9
|
+
width: "100%",
|
|
10
|
+
},
|
|
8
11
|
confirmButton: {
|
|
9
12
|
marginTop: spaceXL,
|
|
10
13
|
},
|
|
14
|
+
description: {
|
|
15
|
+
marginVertical: spaceXL,
|
|
16
|
+
textAlign: "center",
|
|
17
|
+
width: "100%",
|
|
18
|
+
},
|
|
11
19
|
modal: {
|
|
12
20
|
padding: spaceXL,
|
|
13
21
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
textAlign: "center",
|
|
22
|
+
title: {
|
|
23
|
+
width: "100%",
|
|
17
24
|
},
|
|
18
25
|
});
|
|
19
26
|
export { style };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
|
|
1
|
+
import { ALIGN, Button, BUTTON_VARIANT, Text } from "@lookiero/aurora";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React, { useMemo } from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
@@ -20,7 +20,7 @@ const ItemActions = ({ productVariants, currentProductVariant, country, onSizeSe
|
|
|
20
20
|
(sizeSelectorOptions.length === 1 && sizeSelectorOptions[0]?.value === currentProductVariant.id), [sizeSelectorOptions, currentProductVariant.id]);
|
|
21
21
|
return (React.createElement(Sticky, { onLayout: onLayout },
|
|
22
22
|
React.createElement(Body, { style: { column: style.container } },
|
|
23
|
-
React.createElement(Button, { onPress: onKeep }, keepButtonText),
|
|
23
|
+
React.createElement(Button, { testID: "keep-button", onPress: onKeep }, keepButtonText),
|
|
24
24
|
React.createElement(View, { style: style.row },
|
|
25
25
|
!currentProductVariant.size.unique && productVariants && (React.createElement(SelectField, { ...(disabledSizeSelector && {
|
|
26
26
|
onPress: onSizeSelectorPress,
|
|
@@ -29,6 +29,7 @@ const ItemActions = ({ productVariants, currentProductVariant, country, onSizeSe
|
|
|
29
29
|
inputField: { input: disabledSizeSelector && style.inputDisabled },
|
|
30
30
|
}, onChange: onReplace })),
|
|
31
31
|
React.createElement(View, { style: style.returnButtonContainer },
|
|
32
|
-
React.createElement(Button, { variant: BUTTON_VARIANT.SECONDARY, onPress: onReturn },
|
|
32
|
+
React.createElement(Button, { testID: "return-button", variant: BUTTON_VARIANT.SECONDARY, onPress: onReturn },
|
|
33
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, returnButtonText)))))));
|
|
33
34
|
};
|
|
34
35
|
export { ItemActions };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const { colorGrayscaleL,
|
|
3
|
+
const { colorGrayscaleL, spaceL, spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
+
buttonText: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
},
|
|
5
8
|
container: {
|
|
6
9
|
paddingHorizontal: spaceXL,
|
|
7
10
|
},
|
|
@@ -14,11 +17,11 @@ const style = StyleSheet.create({
|
|
|
14
17
|
row: {
|
|
15
18
|
alignItems: "center",
|
|
16
19
|
flexDirection: "row",
|
|
17
|
-
marginTop:
|
|
20
|
+
marginTop: spaceL,
|
|
18
21
|
},
|
|
19
22
|
sizeSelector: {
|
|
20
23
|
flex: 1,
|
|
21
|
-
marginRight:
|
|
24
|
+
marginRight: spaceL,
|
|
22
25
|
},
|
|
23
26
|
});
|
|
24
27
|
export { style };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const {
|
|
3
|
+
const { spaceS, spaceL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
container: {
|
|
6
6
|
width: "100%",
|
|
7
7
|
},
|
|
8
8
|
name: {
|
|
9
|
-
marginVertical:
|
|
9
|
+
marginVertical: spaceS,
|
|
10
10
|
},
|
|
11
11
|
size: {
|
|
12
|
-
|
|
13
|
-
marginTop: spaceL,
|
|
12
|
+
marginVertical: spaceL,
|
|
14
13
|
},
|
|
15
14
|
});
|
|
16
15
|
export { style };
|
package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import React, { useCallback } from "react";
|
|
2
|
-
import { Image
|
|
3
|
-
import {
|
|
4
|
-
import { Carousel2, } from "../../../../../../shared/ui/components/layouts/carousel/Carousel2";
|
|
5
|
-
import { Bullets } from "../../../../../../shared/ui/components/layouts/slider/Bullets";
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { Image } from "react-native";
|
|
3
|
+
import { Slider } from "../../../../../../shared/ui/components/layouts/slider/Slider";
|
|
6
4
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
7
5
|
import { style } from "./ProductVariantSlider.style";
|
|
8
6
|
const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
|
|
9
7
|
const cdnImageUrl = useMediaImage();
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
const [active, setActive] = useState(0);
|
|
9
|
+
const handleOnActiveChanged = useCallback((activeIndex) => {
|
|
10
|
+
setActive(activeIndex);
|
|
11
|
+
onChanged?.(activeIndex);
|
|
12
|
+
}, [onChanged]);
|
|
13
|
+
return (React.createElement(Slider, { active: active, paginationActiveItemStyle: style.paginationActiveItemStyle, paginationItemStyle: style.paginationItemStyle, paginationStyle: style.paginationStyle, paginationRenderItem: (index) => (React.createElement(Image, { key: producVariantMedia[index]?.perspective, resizeMode: "contain", style: style.paginationImage, testID: "product-variant-pagination-image", source: {
|
|
14
|
+
uri: cdnImageUrl({
|
|
15
|
+
url: producVariantMedia[index]?.url,
|
|
16
|
+
width: 80,
|
|
17
|
+
}),
|
|
18
|
+
} })), onChanged: handleOnActiveChanged }, producVariantMedia.map((media) => (React.createElement(Image, { key: media.perspective, resizeMode: "contain", style: style.image, testID: "product-variant-image", source: {
|
|
19
|
+
uri: cdnImageUrl({
|
|
20
|
+
url: media.url,
|
|
21
|
+
width: 600,
|
|
22
|
+
}),
|
|
23
|
+
} })))));
|
|
21
24
|
};
|
|
22
25
|
export { ProductVariantSlider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const { colorBase, colorGrayscaleL, colorContent, spaceM
|
|
3
|
+
const { colorBase, colorGrayscaleL, colorContent, spaceM } = theme();
|
|
4
4
|
const PAGINATION_SIZE = 37;
|
|
5
5
|
const style = StyleSheet.create({
|
|
6
6
|
image: {
|
|
@@ -25,8 +25,5 @@ const style = StyleSheet.create({
|
|
|
25
25
|
marginTop: spaceM,
|
|
26
26
|
position: "relative",
|
|
27
27
|
},
|
|
28
|
-
slide: {
|
|
29
|
-
paddingHorizontal: spaceXL,
|
|
30
|
-
},
|
|
31
28
|
});
|
|
32
29
|
export { style };
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PortalHost } from "@gorhom/portal";
|
|
2
|
-
import { Button, Text } from "@lookiero/aurora";
|
|
2
|
+
import { ALIGN, Button, Text } from "@lookiero/aurora";
|
|
3
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
4
|
import React, { useCallback } from "react";
|
|
5
5
|
import { View } from "react-native";
|
|
@@ -35,6 +35,7 @@ const ReturnQuestionsForm = ({ returnQuestions, visible, onSubmit, onClose }) =>
|
|
|
35
35
|
React.createElement(View, { style: style.returnQuestionsContainer },
|
|
36
36
|
React.createElement(Text, { level: 2, style: style.title }, titleText),
|
|
37
37
|
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
|
|
38
|
-
React.createElement(Button, { style: style.submit, onPress: handleOnSubmit },
|
|
38
|
+
React.createElement(Button, { style: style.submit, testID: "return-questions-button", onPress: handleOnSubmit },
|
|
39
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, submitButtonText))))));
|
|
39
40
|
};
|
|
40
41
|
export { ReturnQuestionsForm };
|
|
@@ -2,6 +2,9 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
3
|
const { spaceS, spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
+
buttonText: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
},
|
|
5
8
|
returnQuestionsContainer: {
|
|
6
9
|
paddingHorizontal: spaceXL,
|
|
7
10
|
},
|
package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js
CHANGED
|
@@ -11,8 +11,9 @@ const SizeWithoutStockModal = ({ visible, onDismiss }) => {
|
|
|
11
11
|
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
12
12
|
return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
|
|
13
13
|
React.createElement(View, { style: style.modal },
|
|
14
|
-
React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
|
|
15
|
-
React.createElement(Text, { level: 3, style: style.
|
|
16
|
-
React.createElement(Button, { style: style.button, onPress: onDismiss },
|
|
14
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
|
|
15
|
+
React.createElement(Text, { level: 3, style: style.description }, descriptionText),
|
|
16
|
+
React.createElement(Button, { style: style.button, onPress: onDismiss },
|
|
17
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, buttonText)))));
|
|
17
18
|
};
|
|
18
19
|
export { SizeWithoutStockModal };
|
|
@@ -2,12 +2,19 @@ declare const style: {
|
|
|
2
2
|
button: {
|
|
3
3
|
flex: number;
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
buttonText: {
|
|
6
|
+
width: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
description: {
|
|
9
9
|
marginVertical: number;
|
|
10
10
|
textAlign: "center";
|
|
11
|
+
width: string;
|
|
12
|
+
};
|
|
13
|
+
modal: {
|
|
14
|
+
padding: number;
|
|
15
|
+
};
|
|
16
|
+
title: {
|
|
17
|
+
width: string;
|
|
11
18
|
};
|
|
12
19
|
};
|
|
13
20
|
export { style };
|
|
@@ -5,12 +5,19 @@ const style = StyleSheet.create({
|
|
|
5
5
|
button: {
|
|
6
6
|
flex: 0,
|
|
7
7
|
},
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
buttonText: {
|
|
9
|
+
width: "100%",
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
description: {
|
|
12
12
|
marginVertical: spaceXL,
|
|
13
13
|
textAlign: "center",
|
|
14
|
+
width: "100%",
|
|
15
|
+
},
|
|
16
|
+
modal: {
|
|
17
|
+
padding: spaceXL,
|
|
18
|
+
},
|
|
19
|
+
title: {
|
|
20
|
+
width: "100%",
|
|
14
21
|
},
|
|
15
22
|
});
|
|
16
23
|
export { style };
|