@lookiero/checkout 3.8.0 → 3.9.0-beta.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/projection/checkout/checkout.js +14 -0
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +7 -5
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.d.ts +15 -0
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.js +14 -0
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +1 -1
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.d.ts +0 -1
- 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 +0 -1
- 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 +1 -0
- package/dist/infrastructure/ui/components/templates/header/Header.style.js +3 -1
- package/dist/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +1 -1
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +4 -6
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +3 -10
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +3 -10
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +3 -4
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.js +3 -6
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +2 -1
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +4 -3
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +9 -15
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.d.ts +3 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.js +3 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +0 -1
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +0 -1
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +2 -3
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -3
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +3 -4
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +3 -10
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +3 -10
- package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +2 -1
- package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.d.ts +0 -4
- package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.js +0 -4
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +7 -8
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +0 -6
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +0 -6
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +3 -4
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.d.ts +3 -10
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.js +3 -10
- package/dist/shared/ui/components/atoms/input/Input.js +2 -2
- package/dist/shared/ui/components/layouts/carousel/Carousel.d.ts +11 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel.js +31 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel.style.d.ts +24 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel.style.js +25 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel2.d.ts +30 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel2.js +79 -0
- package/dist/shared/ui/components/layouts/carousel/DragComponent.d.ts +3 -0
- package/dist/shared/ui/components/layouts/carousel/DragComponent.js +48 -0
- package/dist/shared/ui/components/layouts/modal/Modal.js +1 -1
- package/dist/shared/ui/components/layouts/slider/Bullets.d.ts +10 -0
- package/dist/shared/ui/components/layouts/slider/Bullets.js +28 -0
- package/dist/shared/ui/components/layouts/slider/Bullets.style.d.ts +12 -0
- package/dist/shared/ui/components/layouts/slider/Bullets.style.js +15 -0
- package/dist/shared/ui/components/layouts/slider/Bullets2.d.ts +10 -0
- package/dist/shared/ui/components/layouts/slider/Bullets2.js +30 -0
- package/dist/shared/ui/components/layouts/slider/Slider.d.ts +0 -5
- package/dist/shared/ui/components/layouts/slider/Slider.js +4 -4
- package/dist/shared/ui/components/layouts/slider/SliderDots.d.ts +8 -0
- package/dist/shared/ui/components/layouts/slider/SliderDots.js +16 -0
- package/dist/shared/ui/components/layouts/slider/SliderDots.style.d.ts +12 -0
- package/dist/shared/ui/components/layouts/slider/SliderDots.style.js +15 -0
- package/dist/shared/ui/components/layouts/sticky/Sticky.js +1 -3
- package/dist/shared/ui/components/layouts/sticky/Sticky.style.d.ts +3 -0
- package/dist/shared/ui/components/layouts/sticky/Sticky.style.js +3 -2
- package/dist/shared/ui/components/molecules/selectField/SelectField.js +3 -3
- package/package.json +8 -1
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
})),
|
|
3
17
|
expiresOn: new Date(checkoutDto.expiresOn),
|
|
4
18
|
});
|
|
5
19
|
export { toCheckoutProjection };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { GestureHandlerRootView, ScrollView as RNGHScrollView } from "react-native-gesture-handler";
|
|
4
5
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
5
6
|
import { Footer as DefaultFooter } from "../../../templates/footer/Footer";
|
|
6
7
|
import { DefaultHeader } from "../../../templates/header/defaultHeader/DefaultHeader";
|
|
@@ -8,9 +9,10 @@ import { Footer } from "../components/footer/Footer";
|
|
|
8
9
|
import { Header } from "../components/header/Header";
|
|
9
10
|
import { style } from "./DummyLayout.style";
|
|
10
11
|
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] },
|
|
11
|
-
React.createElement(
|
|
12
|
-
React.createElement(
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
|
|
13
|
+
React.createElement(RNGHScrollView, { contentContainerStyle: [style.scrollView, customStyle?.scrollView], scrollEnabled: scrollEnabled, scrollEventThrottle: 16, showsVerticalScrollIndicator: false, stickyHeaderIndices: [0] },
|
|
14
|
+
React.createElement(Header, null, header),
|
|
15
|
+
panel,
|
|
16
|
+
React.createElement(View, { style: style.children, onLayout: onLayout }, children))),
|
|
15
17
|
React.createElement(Footer, null, footer)));
|
|
16
18
|
export { DummyLayout };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode, Ref } from "react";
|
|
2
|
+
import { GestureType, ScrollView } from "react-native-gesture-handler";
|
|
3
|
+
interface ContextShape {
|
|
4
|
+
readonly scrollViewRef: Ref<ScrollView>;
|
|
5
|
+
readonly panGestureRef: Ref<GestureType>;
|
|
6
|
+
}
|
|
7
|
+
interface ScrollViewRefContextProviderProps {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const ScrollViewRefContextProvider: FC<ScrollViewRefContextProviderProps>;
|
|
11
|
+
interface UseScrollViewRefFunction {
|
|
12
|
+
(): ContextShape;
|
|
13
|
+
}
|
|
14
|
+
declare const useScrollViewRef: UseScrollViewRefFunction;
|
|
15
|
+
export { useScrollViewRef, ScrollViewRefContextProvider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { createContext, useContext, useRef } from "react";
|
|
2
|
+
import invariant from "tiny-invariant";
|
|
3
|
+
const ScrollViewRefContext = createContext(null);
|
|
4
|
+
const ScrollViewRefContextProvider = ({ children }) => {
|
|
5
|
+
const scrollViewRef = useRef(null);
|
|
6
|
+
const panGestureRef = useRef(null);
|
|
7
|
+
return (React.createElement(ScrollViewRefContext.Provider, { value: { scrollViewRef, panGestureRef } }, children));
|
|
8
|
+
};
|
|
9
|
+
const useScrollViewRef = () => {
|
|
10
|
+
const ref = useContext(ScrollViewRefContext);
|
|
11
|
+
invariant(ref, "Your are trying to use the useScrollViewRef hook without wrapping your app with the <ScrollViewRefContextProvider>.");
|
|
12
|
+
return ref;
|
|
13
|
+
};
|
|
14
|
+
export { useScrollViewRef, ScrollViewRefContextProvider };
|
|
@@ -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 },
|
|
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,7 +5,6 @@ interface CheckoutQuestionItemProps {
|
|
|
5
5
|
readonly checkoutQuestionParentId: string;
|
|
6
6
|
readonly children?: ReactNode;
|
|
7
7
|
readonly portalHostName?: string;
|
|
8
|
-
readonly testID?: string;
|
|
9
8
|
}
|
|
10
9
|
type CheckoutQuestionItem = FC<CheckoutQuestionItemProps>;
|
|
11
10
|
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, }) => {
|
|
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, {
|
|
12
|
+
return (React.createElement(Button, { style: [style.button, { backgroundColor: feedback === checkoutQuestion.id ? colorAccent : colorBase }], 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, }) => {
|
|
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, {
|
|
25
|
-
React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon })));
|
|
24
|
+
return (React.createElement(Pressable, { onPress: handleOnPress },
|
|
25
|
+
React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon, testID: checkoutQuestion.name })));
|
|
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, }) => {
|
|
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,
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, 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 },
|
|
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,7 +5,6 @@ interface ReturnQuestionItemProps {
|
|
|
5
5
|
readonly returnQuestionParentId: string;
|
|
6
6
|
readonly children?: ReactNode;
|
|
7
7
|
readonly portalHostName?: string;
|
|
8
|
-
readonly testID?: string;
|
|
9
8
|
}
|
|
10
9
|
type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
|
|
11
10
|
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, }) => {
|
|
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, {
|
|
34
|
+
React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, 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, }) => {
|
|
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, {
|
|
11
|
+
return (React.createElement(TouchableHighlight, { style: style.container, 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, }) => {
|
|
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,
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
12
12
|
};
|
|
13
13
|
export { TextareaReturnQuestionItem };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../theme/theme";
|
|
3
|
-
const { colorBase, spaceS } = theme();
|
|
3
|
+
const { colorBase, spaceS, spaceXXXL } = theme();
|
|
4
|
+
const HEADER_HEIGHT = spaceXXXL;
|
|
4
5
|
const style = StyleSheet.create({
|
|
5
6
|
header: {
|
|
6
7
|
alignItems: "center",
|
|
@@ -8,6 +9,7 @@ const style = StyleSheet.create({
|
|
|
8
9
|
flexDirection: "row",
|
|
9
10
|
flexGrow: 0,
|
|
10
11
|
flexWrap: "nowrap",
|
|
12
|
+
height: HEADER_HEIGHT,
|
|
11
13
|
justifyContent: "space-between",
|
|
12
14
|
overflow: "visible",
|
|
13
15
|
paddingHorizontal: spaceS,
|
|
@@ -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,
|
|
35
|
+
React.createElement(Button, { busy: submitButtonDisabled, style: style.button, onPress: handlePress }, buttonText)));
|
|
36
36
|
};
|
|
37
37
|
export { CheckoutQuestionsForm };
|
package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js
CHANGED
|
@@ -12,11 +12,9 @@ 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
|
|
16
|
-
React.createElement(Text, { level: 3, style: style.
|
|
17
|
-
React.createElement(Button, { style: style.button, onPress: onDismiss },
|
|
18
|
-
|
|
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)))));
|
|
15
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
|
|
16
|
+
React.createElement(Text, { level: 3, style: style.modalDescription }, descriptionText),
|
|
17
|
+
React.createElement(Button, { style: style.button, onPress: onDismiss }, dismissButtonText),
|
|
18
|
+
React.createElement(Button, { style: [style.button, style.confirmButton], variant: BUTTON_VARIANT.SECONDARY, onPress: onConfirm }, confirmButtonText))));
|
|
21
19
|
};
|
|
22
20
|
export { GetOutOfCheckoutModal };
|
|
@@ -2,22 +2,15 @@ declare const style: {
|
|
|
2
2
|
button: {
|
|
3
3
|
flex: number;
|
|
4
4
|
};
|
|
5
|
-
buttonText: {
|
|
6
|
-
width: string;
|
|
7
|
-
};
|
|
8
5
|
confirmButton: {
|
|
9
6
|
marginTop: number;
|
|
10
7
|
};
|
|
11
|
-
description: {
|
|
12
|
-
marginVertical: number;
|
|
13
|
-
textAlign: "center";
|
|
14
|
-
width: string;
|
|
15
|
-
};
|
|
16
8
|
modal: {
|
|
17
9
|
padding: number;
|
|
18
10
|
};
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
modalDescription: {
|
|
12
|
+
marginVertical: number;
|
|
13
|
+
textAlign: "center";
|
|
21
14
|
};
|
|
22
15
|
};
|
|
23
16
|
export { style };
|
|
@@ -5,22 +5,15 @@ const style = StyleSheet.create({
|
|
|
5
5
|
button: {
|
|
6
6
|
flex: 0,
|
|
7
7
|
},
|
|
8
|
-
buttonText: {
|
|
9
|
-
width: "100%",
|
|
10
|
-
},
|
|
11
8
|
confirmButton: {
|
|
12
9
|
marginTop: spaceXL,
|
|
13
10
|
},
|
|
14
|
-
description: {
|
|
15
|
-
marginVertical: spaceXL,
|
|
16
|
-
textAlign: "center",
|
|
17
|
-
width: "100%",
|
|
18
|
-
},
|
|
19
11
|
modal: {
|
|
20
12
|
padding: spaceXL,
|
|
21
13
|
},
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
modalDescription: {
|
|
15
|
+
marginVertical: spaceXL,
|
|
16
|
+
textAlign: "center",
|
|
24
17
|
},
|
|
25
18
|
});
|
|
26
19
|
export { style };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button, BUTTON_VARIANT } 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, {
|
|
23
|
+
React.createElement(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,7 +29,6 @@ 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, {
|
|
33
|
-
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, returnButtonText)))))));
|
|
32
|
+
React.createElement(Button, { variant: BUTTON_VARIANT.SECONDARY, onPress: onReturn }, returnButtonText))))));
|
|
34
33
|
};
|
|
35
34
|
export { ItemActions };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const { colorGrayscaleL,
|
|
3
|
+
const { colorGrayscaleL, spaceM, spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
-
buttonText: {
|
|
6
|
-
width: "100%",
|
|
7
|
-
},
|
|
8
5
|
container: {
|
|
9
6
|
paddingHorizontal: spaceXL,
|
|
10
7
|
},
|
|
@@ -17,11 +14,11 @@ const style = StyleSheet.create({
|
|
|
17
14
|
row: {
|
|
18
15
|
alignItems: "center",
|
|
19
16
|
flexDirection: "row",
|
|
20
|
-
marginTop:
|
|
17
|
+
marginTop: spaceM,
|
|
21
18
|
},
|
|
22
19
|
sizeSelector: {
|
|
23
20
|
flex: 1,
|
|
24
|
-
marginRight:
|
|
21
|
+
marginRight: spaceM,
|
|
25
22
|
},
|
|
26
23
|
});
|
|
27
24
|
export { style };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const {
|
|
3
|
+
const { spaceXS, spaceL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
container: {
|
|
6
6
|
width: "100%",
|
|
7
7
|
},
|
|
8
8
|
name: {
|
|
9
|
-
marginVertical:
|
|
9
|
+
marginVertical: spaceXS,
|
|
10
10
|
},
|
|
11
11
|
size: {
|
|
12
|
-
|
|
12
|
+
marginBottom: spaceXS,
|
|
13
|
+
marginTop: spaceL,
|
|
13
14
|
},
|
|
14
15
|
});
|
|
15
16
|
export { style };
|
package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import React, { useCallback
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
2
|
import { Image } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { Carousel2, } from "../../../../../../shared/ui/components/layouts/carousel/Carousel2";
|
|
4
|
+
import { Bullets } from "../../../../../../shared/ui/components/layouts/slider/Bullets";
|
|
4
5
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
5
6
|
import { style } from "./ProductVariantSlider.style";
|
|
6
7
|
const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
|
|
7
8
|
const cdnImageUrl = useMediaImage();
|
|
8
|
-
const
|
|
9
|
-
const
|
|
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: {
|
|
9
|
+
const handleOnActiveChanged = useCallback((activeIndex) => onChanged?.(activeIndex), [onChanged]);
|
|
10
|
+
const renderItem = useCallback(({ item }) => (React.createElement(Image, { resizeMode: "contain", style: style.image, testID: "product-variant-image", source: {
|
|
19
11
|
uri: cdnImageUrl({
|
|
20
|
-
url:
|
|
12
|
+
url: item.url,
|
|
21
13
|
width: 600,
|
|
22
14
|
}),
|
|
23
|
-
} })))
|
|
15
|
+
} })), [cdnImageUrl]);
|
|
16
|
+
const renderBullets = useCallback(({ activeIndex, count, onChange }) => React.createElement(Bullets, { activeIndex: activeIndex, count: count, onChange: onChange }), []);
|
|
17
|
+
return (React.createElement(Carousel2, { bullets: renderBullets, data: producVariantMedia, style: { container: style.carousel }, onActiveIndexChanged: handleOnActiveChanged }, renderItem));
|
|
24
18
|
};
|
|
25
19
|
export { ProductVariantSlider };
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PortalHost } from "@gorhom/portal";
|
|
2
|
-
import {
|
|
2
|
+
import { 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,7 +35,6 @@ 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,
|
|
39
|
-
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, submitButtonText))))));
|
|
38
|
+
React.createElement(Button, { style: style.submit, onPress: handleOnSubmit }, submitButtonText)))));
|
|
40
39
|
};
|
|
41
40
|
export { ReturnQuestionsForm };
|
|
@@ -2,9 +2,6 @@ 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
|
-
},
|
|
8
5
|
returnQuestionsContainer: {
|
|
9
6
|
paddingHorizontal: spaceXL,
|
|
10
7
|
},
|
package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js
CHANGED
|
@@ -11,9 +11,8 @@ 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
|
|
15
|
-
React.createElement(Text, { level: 3, style: style.
|
|
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)))));
|
|
14
|
+
React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
|
|
15
|
+
React.createElement(Text, { level: 3, style: style.modalDescription }, descriptionText),
|
|
16
|
+
React.createElement(Button, { style: style.button, onPress: onDismiss }, buttonText))));
|
|
18
17
|
};
|
|
19
18
|
export { SizeWithoutStockModal };
|
|
@@ -2,19 +2,12 @@ declare const style: {
|
|
|
2
2
|
button: {
|
|
3
3
|
flex: number;
|
|
4
4
|
};
|
|
5
|
-
buttonText: {
|
|
6
|
-
width: string;
|
|
7
|
-
};
|
|
8
|
-
description: {
|
|
9
|
-
marginVertical: number;
|
|
10
|
-
textAlign: "center";
|
|
11
|
-
width: string;
|
|
12
|
-
};
|
|
13
5
|
modal: {
|
|
14
6
|
padding: number;
|
|
15
7
|
};
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
modalDescription: {
|
|
9
|
+
marginVertical: number;
|
|
10
|
+
textAlign: "center";
|
|
18
11
|
};
|
|
19
12
|
};
|
|
20
13
|
export { style };
|
|
@@ -5,19 +5,12 @@ const style = StyleSheet.create({
|
|
|
5
5
|
button: {
|
|
6
6
|
flex: 0,
|
|
7
7
|
},
|
|
8
|
-
buttonText: {
|
|
9
|
-
width: "100%",
|
|
10
|
-
},
|
|
11
|
-
description: {
|
|
12
|
-
marginVertical: spaceXL,
|
|
13
|
-
textAlign: "center",
|
|
14
|
-
width: "100%",
|
|
15
|
-
},
|
|
16
8
|
modal: {
|
|
17
9
|
padding: spaceXL,
|
|
18
10
|
},
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
modalDescription: {
|
|
12
|
+
marginVertical: spaceXL,
|
|
13
|
+
textAlign: "center",
|
|
21
14
|
},
|
|
22
15
|
});
|
|
23
16
|
export { style };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { useTrackImageView } from "../../../../../../shared/tracking/infrastructure/useTrackImageView";
|
|
4
|
+
import { AspectRatioView } from "../../../../../../shared/ui/components/atoms/aspectRatioView/AspectRatioView";
|
|
4
5
|
import { TrackingPage } from "../../../../../tracking/tracking";
|
|
5
6
|
import { ProductVariantDescription } from "../../components/productVariantDescription/ProductVariantDescription";
|
|
6
7
|
import { ProductVariantSlider } from "../../components/productVariantSlider/ProductVariantSlider";
|
|
@@ -20,7 +21,7 @@ const ProductVariant = ({ country, checkoutId, checkoutItem, currentProductVaria
|
|
|
20
21
|
const { price } = checkoutItem;
|
|
21
22
|
const { media, brand, name, color } = checkoutItem.productVariant;
|
|
22
23
|
return (React.createElement(View, { style: [style.content, customStyle?.content], testID: "product-variant" },
|
|
23
|
-
React.createElement(
|
|
24
|
+
React.createElement(AspectRatioView, { aspectRatio: 4 / 3 },
|
|
24
25
|
React.createElement(ProductVariantSlider, { producVariantMedia: media, onChanged: handleOnChangedProductVariantSlider })),
|
|
25
26
|
React.createElement(ProductVariantDescription, { brand: brand, color: color, country: country, name: name, price: price, size: currentProductVariant.size }),
|
|
26
27
|
children));
|