@lookiero/checkout 0.2.23 → 0.2.25
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/ui/Root.js +1 -1
- package/dist/infrastructure/ui/components/atoms/modal/Modal.style.d.ts +2 -2
- package/dist/infrastructure/ui/components/atoms/modal/Modal.style.js +2 -2
- package/dist/infrastructure/ui/components/atoms/price/Price.js +2 -2
- package/dist/infrastructure/ui/components/atoms/price/Price.style.d.ts +4 -4
- package/dist/infrastructure/ui/components/atoms/price/Price.style.js +4 -4
- package/dist/infrastructure/ui/components/layouts/body/Body.style.d.ts +3 -3
- package/dist/infrastructure/ui/components/layouts/body/Body.style.js +3 -3
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.d.ts +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +14 -10
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +13 -19
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.d.ts +4 -10
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.js +5 -14
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.d.ts +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.d.ts +10 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +41 -14
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +4 -4
- package/dist/infrastructure/ui/routing/Routing.js +2 -2
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.js +1 -1
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.js +3 -2
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.style.d.ts +9 -2
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.style.js +9 -2
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.d.ts +3 -3
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.js +3 -3
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.js +2 -2
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.style.d.ts +4 -4
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.style.js +5 -5
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.js +1 -1
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.style.d.ts +1 -1
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.style.js +1 -1
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.d.ts +1 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.js +12 -10
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.d.ts +23 -26
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.js +22 -25
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.d.ts +2 -2
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.js +2 -2
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.js +2 -2
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.style.d.ts +12 -12
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.style.js +12 -12
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.js +2 -2
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.d.ts +5 -3
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.js +1 -1
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.js +3 -3
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.style.d.ts +4 -4
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.style.js +4 -4
- package/dist/infrastructure/ui/views/intro/Intro.js +6 -6
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +20 -20
- package/dist/infrastructure/ui/views/intro/Intro.style.js +21 -21
- package/dist/infrastructure/ui/views/item/Item.js +1 -1
- package/dist/infrastructure/ui/views/item/Item.style.d.ts +5 -5
- package/dist/infrastructure/ui/views/item/Item.style.js +5 -5
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +2 -2
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.d.ts +6 -6
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.js +6 -6
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +7 -7
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +7 -7
- package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.js +1 -1
- package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.style.d.ts +6 -6
- package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.style.js +6 -6
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +4 -4
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +3 -3
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +3 -3
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +3 -3
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.d.ts +7 -7
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.js +7 -7
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +5 -5
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +5 -5
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +7 -14
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +2 -2
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +4 -4
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +4 -4
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +4 -4
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +4 -4
- package/dist/infrastructure/ui/views/summary/Summary.js +1 -2
- package/package.json +2 -1
|
@@ -8,6 +8,6 @@ const root = ({ Messaging, I18n, development }) =>
|
|
|
8
8
|
const handleOnI18nError = useCallback(() => void 0, []);
|
|
9
9
|
return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
|
|
10
10
|
React.createElement(Router, null,
|
|
11
|
-
React.createElement(Routing, {
|
|
11
|
+
React.createElement(Routing, { I18n: I18n, customerId: customerId, locale: locale, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible }))));
|
|
12
12
|
};
|
|
13
13
|
export { root };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
declare const style: {
|
|
2
2
|
centeredView: {
|
|
3
|
+
backgroundColor: string;
|
|
3
4
|
flex: number;
|
|
4
5
|
justifyContent: "center";
|
|
5
|
-
backgroundColor: string;
|
|
6
6
|
paddingHorizontal: number;
|
|
7
7
|
};
|
|
8
8
|
modalView: {
|
|
9
9
|
backgroundColor: string;
|
|
10
|
+
elevation: number;
|
|
10
11
|
padding: number;
|
|
11
12
|
shadowColor: string;
|
|
12
13
|
shadowOffset: {
|
|
@@ -15,7 +16,6 @@ declare const style: {
|
|
|
15
16
|
};
|
|
16
17
|
shadowOpacity: number;
|
|
17
18
|
shadowRadius: number;
|
|
18
|
-
elevation: number;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
export { style };
|
|
@@ -3,13 +3,14 @@ import { theme } from "../../../theme/theme";
|
|
|
3
3
|
const { colorBase, colorContent, colorOverlay, spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
centeredView: {
|
|
6
|
+
backgroundColor: colorOverlay,
|
|
6
7
|
flex: 1,
|
|
7
8
|
justifyContent: "center",
|
|
8
|
-
backgroundColor: colorOverlay,
|
|
9
9
|
paddingHorizontal: spaceXL,
|
|
10
10
|
},
|
|
11
11
|
modalView: {
|
|
12
12
|
backgroundColor: colorBase,
|
|
13
|
+
elevation: 5,
|
|
13
14
|
padding: spaceXL,
|
|
14
15
|
shadowColor: colorContent,
|
|
15
16
|
shadowOffset: {
|
|
@@ -18,7 +19,6 @@ const style = StyleSheet.create({
|
|
|
18
19
|
},
|
|
19
20
|
shadowOpacity: 0.25,
|
|
20
21
|
shadowRadius: 4,
|
|
21
|
-
elevation: 5,
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
24
|
export { style };
|
|
@@ -16,7 +16,7 @@ const Price = ({ price }) => {
|
|
|
16
16
|
currency: price.currency,
|
|
17
17
|
});
|
|
18
18
|
return (React.createElement(View, { style: style.price, testID: "price" },
|
|
19
|
-
React.createElement(Text, {
|
|
20
|
-
isDiscounted && (React.createElement(Text, {
|
|
19
|
+
React.createElement(Text, { level: 3, style: isDiscounted && style.priceTextDiscounted, testID: "price-text", body: true }, productPrice),
|
|
20
|
+
isDiscounted && (React.createElement(Text, { level: 3, style: style.discountedPriceText, testID: "discounted-price-text", body: true }, productDiscountedPrice))));
|
|
21
21
|
};
|
|
22
22
|
export { Price };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare const style: {
|
|
2
|
+
discountedPriceText: {
|
|
3
|
+
color: string;
|
|
4
|
+
marginLeft: number;
|
|
5
|
+
};
|
|
2
6
|
price: {
|
|
3
7
|
flexDirection: "row";
|
|
4
8
|
};
|
|
5
9
|
priceTextDiscounted: {
|
|
6
10
|
textDecorationLine: "line-through";
|
|
7
11
|
};
|
|
8
|
-
discountedPriceText: {
|
|
9
|
-
marginLeft: number;
|
|
10
|
-
color: string;
|
|
11
|
-
};
|
|
12
12
|
};
|
|
13
13
|
export { style };
|
|
@@ -2,15 +2,15 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "../../../theme/theme";
|
|
3
3
|
const { colorPrimary, spaceS } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
+
discountedPriceText: {
|
|
6
|
+
color: colorPrimary,
|
|
7
|
+
marginLeft: spaceS,
|
|
8
|
+
},
|
|
5
9
|
price: {
|
|
6
10
|
flexDirection: "row",
|
|
7
11
|
},
|
|
8
12
|
priceTextDiscounted: {
|
|
9
13
|
textDecorationLine: "line-through",
|
|
10
14
|
},
|
|
11
|
-
discountedPriceText: {
|
|
12
|
-
marginLeft: spaceS,
|
|
13
|
-
color: colorPrimary,
|
|
14
|
-
},
|
|
15
15
|
});
|
|
16
16
|
export { style };
|
|
@@ -2,12 +2,12 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "../../../theme/theme";
|
|
3
3
|
const { spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
+
column: {
|
|
6
|
+
paddingHorizontal: spaceXL,
|
|
7
|
+
},
|
|
5
8
|
row: {
|
|
6
9
|
flex: 1,
|
|
7
10
|
justifyContent: "center",
|
|
8
11
|
},
|
|
9
|
-
column: {
|
|
10
|
-
paddingHorizontal: spaceXL,
|
|
11
|
-
},
|
|
12
12
|
});
|
|
13
13
|
export { style };
|
|
@@ -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, { returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId
|
|
6
|
-
React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, returnQuestion: childReturnQuestion, returnQuestionParentId: returnQuestion.id
|
|
5
|
+
return (React.createElement(Item, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId },
|
|
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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ReturnQuestion from "./ReturnQuestion";
|
|
3
|
-
const ReturnQuestions = ({ returnQuestions, portalHostName }) => (React.createElement(React.Fragment, null, returnQuestions.map((returnQuestion) => (React.createElement(ReturnQuestion, { key: returnQuestion.id, returnQuestion: returnQuestion, returnQuestionParentId: ""
|
|
3
|
+
const ReturnQuestions = ({ returnQuestions, portalHostName }) => (React.createElement(React.Fragment, null, returnQuestions.map((returnQuestion) => (React.createElement(ReturnQuestion, { key: returnQuestion.id, portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParentId: "" })))));
|
|
4
4
|
export { ReturnQuestions };
|
|
@@ -2,30 +2,34 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
2
2
|
import React, { useCallback, useState } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { TouchableHighlight, View } from "react-native";
|
|
5
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
5
|
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
7
6
|
import { Modal } from "../../../../../shared/components/layouts/modal/Modal";
|
|
7
|
+
import { ButtonIcon } from "../../../../../shared/components/molecules/buttonIcon/ButtonIcon";
|
|
8
8
|
import { InputField } from "../../../../../shared/components/molecules/inputField/InputField";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
9
|
+
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
10
|
+
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
12
11
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
13
|
-
const { spaceXL } = theme();
|
|
14
12
|
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
15
|
-
const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
|
|
16
13
|
const placeholderText = useI18nMessage({ id: returnQuestion.placeholder, prefix: RETURN_QUESTIONS_PREFIX });
|
|
17
14
|
const [modalVisible, setModalVisible] = useState(false);
|
|
18
15
|
const handleOnPress = useCallback(() => setModalVisible(true), []);
|
|
19
16
|
const handleOnModalClose = useCallback(() => setModalVisible(false), []);
|
|
20
17
|
const feedback = useReturnQuestionFeedback();
|
|
18
|
+
const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestion.id });
|
|
21
19
|
const intl = useIntl();
|
|
22
20
|
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: `${RETURN_QUESTIONS_PREFIX}${returnQuestionName}`, defaultMessage: returnQuestionName }), [intl]);
|
|
23
21
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
22
|
+
const deepestReturnQuestionWithFeedback = deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
23
|
+
feedback,
|
|
24
|
+
returnQuestion,
|
|
25
|
+
});
|
|
26
|
+
const handleOnBackButtonPress = useCallback(() => deepestReturnQuestionWithFeedback &&
|
|
27
|
+
onChange({ returnQuestionId: deepestReturnQuestionWithFeedback.id, returnQuestionFeedback: undefined }), [deepestReturnQuestionWithFeedback, onChange]);
|
|
24
28
|
return (React.createElement(React.Fragment, null,
|
|
25
|
-
React.createElement(TouchableHighlight, { style: style.container,
|
|
29
|
+
React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
26
30
|
React.createElement(View, { pointerEvents: "none" },
|
|
27
|
-
React.createElement(InputField, {
|
|
28
|
-
React.createElement(Modal, { visible: modalVisible,
|
|
29
|
-
React.createElement(View, { style:
|
|
31
|
+
React.createElement(InputField, { editable: false, icon: "arrow-down", label: placeholderText || "", value: inputValue }))),
|
|
32
|
+
React.createElement(Modal, { portalHostName: portalHostName, visible: modalVisible, header: deepestReturnQuestionWithFeedback && (React.createElement(ButtonIcon, { name: "arrow-left", testID: "modal-back-button", onPress: handleOnBackButtonPress })), scroll: true, onClose: handleOnModalClose },
|
|
33
|
+
React.createElement(View, { style: style.modalContent }, children))));
|
|
30
34
|
};
|
|
31
35
|
export { HostSelectReturnQuestionItem };
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
-
import
|
|
3
|
+
import { animated, useSpring } from "@react-spring/native";
|
|
4
|
+
import React, { useCallback, useState } from "react";
|
|
5
|
+
import { View } from "react-native";
|
|
4
6
|
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
5
|
-
import { ButtonIcon } from "../../../../../shared/components/molecules/buttonIcon/ButtonIcon";
|
|
6
7
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
7
8
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
9
|
import { style } from "./HostStackReturnQuestionItem.style";
|
|
9
10
|
const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
10
11
|
const titleText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
|
|
11
|
-
const { feedback
|
|
12
|
+
const { feedback } = useReturnQuestionFeedbackForId({ id: returnQuestion.id });
|
|
12
13
|
const feedbackReturnQuestion = feedback
|
|
13
14
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
14
15
|
: undefined;
|
|
15
16
|
const feedbackText = useI18nMessage({ id: feedbackReturnQuestion?.name, prefix: RETURN_QUESTIONS_PREFIX });
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
React.createElement(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, returnQuestion: childReturnQuestion, returnQuestionParentId: feedbackReturnQuestion.id, portalHostName: portalHostName })))));
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return (React.createElement(React.Fragment, null,
|
|
29
|
-
questionTitle,
|
|
30
|
-
children));
|
|
31
|
-
}
|
|
17
|
+
const [stackHeight, setStackHeight] = useState();
|
|
18
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout: { height }, }, }) => setStackHeight(height), []);
|
|
19
|
+
const stackSyle = useSpring({ height: stackHeight });
|
|
20
|
+
return (React.createElement(animated.View, { style: stackSyle },
|
|
21
|
+
React.createElement(View, { onLayout: handleOnLayout },
|
|
22
|
+
titleText && (React.createElement(Text, { level: 2, style: style.title }, titleText)),
|
|
23
|
+
feedbackReturnQuestion ? (React.createElement(React.Fragment, null,
|
|
24
|
+
React.createElement(Text, { level: 3, style: style.feedback }, feedbackText),
|
|
25
|
+
feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParentId: feedbackReturnQuestion.id }))))) : (children))));
|
|
32
26
|
};
|
|
33
27
|
export { HostStackReturnQuestionItem };
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
declare const style: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
zIndex: number;
|
|
2
|
+
feedback: {
|
|
3
|
+
color: string;
|
|
4
|
+
lineHeight: number;
|
|
5
|
+
marginVertical: number;
|
|
7
6
|
};
|
|
8
7
|
title: {
|
|
9
8
|
marginVertical: number;
|
|
10
9
|
textAlign: "center";
|
|
11
10
|
};
|
|
12
|
-
feedback: {
|
|
13
|
-
color: string;
|
|
14
|
-
marginVertical: number;
|
|
15
|
-
lineHeight: number;
|
|
16
|
-
};
|
|
17
11
|
};
|
|
18
12
|
export { style };
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../../theme/theme";
|
|
3
|
-
const { colorGrayscaleL,
|
|
4
|
-
const headerPadding = spaceM;
|
|
5
|
-
const buttonIconPadding = spaceS;
|
|
6
|
-
const backButtonTop = (iconSize + headerPadding + buttonIconPadding * 2) * -1;
|
|
3
|
+
const { colorGrayscaleL, spaceM, spaceL } = theme();
|
|
7
4
|
const style = StyleSheet.create({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
zIndex: 20,
|
|
5
|
+
feedback: {
|
|
6
|
+
color: colorGrayscaleL,
|
|
7
|
+
lineHeight: 24,
|
|
8
|
+
marginVertical: spaceM,
|
|
13
9
|
},
|
|
14
10
|
title: {
|
|
15
11
|
marginVertical: spaceL,
|
|
16
12
|
textAlign: "center",
|
|
17
13
|
},
|
|
18
|
-
feedback: {
|
|
19
|
-
color: colorGrayscaleL,
|
|
20
|
-
marginVertical: spaceM,
|
|
21
|
-
lineHeight: 24,
|
|
22
|
-
},
|
|
23
14
|
});
|
|
24
15
|
export { style };
|
|
@@ -9,7 +9,7 @@ const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) =
|
|
|
9
9
|
const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
|
|
10
10
|
const optionText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
|
|
11
11
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParentId]);
|
|
12
|
-
return (React.createElement(TouchableHighlight, { style: style.container,
|
|
12
|
+
return (React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
13
13
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
14
14
|
};
|
|
15
15
|
export { OptionReturnQuestionItem };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const containerUnderlayColor: string;
|
|
2
2
|
declare const style: {
|
|
3
3
|
container: {
|
|
4
|
-
paddingVertical: number;
|
|
5
|
-
borderBottomWidth: number;
|
|
6
4
|
borderBottomColor: string;
|
|
5
|
+
borderBottomWidth: number;
|
|
6
|
+
paddingVertical: number;
|
|
7
7
|
};
|
|
8
8
|
text: {
|
|
9
9
|
lineHeight: number;
|
|
@@ -4,9 +4,9 @@ const { spaceM, colorGrayscaleS } = theme();
|
|
|
4
4
|
const containerUnderlayColor = colorGrayscaleS;
|
|
5
5
|
const style = StyleSheet.create({
|
|
6
6
|
container: {
|
|
7
|
-
paddingVertical: spaceM,
|
|
8
|
-
borderBottomWidth: 1,
|
|
9
7
|
borderBottomColor: colorGrayscaleS,
|
|
8
|
+
borderBottomWidth: 1,
|
|
9
|
+
paddingVertical: spaceM,
|
|
10
10
|
},
|
|
11
11
|
text: {
|
|
12
12
|
lineHeight: 24,
|
|
@@ -21,7 +21,7 @@ const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
|
|
|
21
21
|
}), [intl]);
|
|
22
22
|
const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(" / ");
|
|
23
23
|
return (React.createElement(View, { style: style.container },
|
|
24
|
-
React.createElement(Text, {
|
|
24
|
+
React.createElement(Text, { level: 2, style: style.title, detail: true }, titleText),
|
|
25
25
|
React.createElement(Text, { level: 3 }, feedback || unansweredText)));
|
|
26
26
|
};
|
|
27
27
|
export { ReturnQuestionFeedbackItem };
|
|
@@ -8,6 +8,6 @@ const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, })
|
|
|
8
8
|
const placeholderText = useI18nMessage({ id: returnQuestion.placeholder, prefix: RETURN_QUESTIONS_PREFIX });
|
|
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, {
|
|
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 };
|
package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.d.ts
CHANGED
|
@@ -10,4 +10,13 @@ interface RecursiveFeedbackForReturnQuestionFunction {
|
|
|
10
10
|
(args: RecursiveFeedbackForReturnQuestionFunctionArgs): string[];
|
|
11
11
|
}
|
|
12
12
|
declare const feedbackForReturnQuestion: RecursiveFeedbackForReturnQuestionFunction;
|
|
13
|
-
|
|
13
|
+
interface RecursiveDeepestReturnQuestionWithFeedbackFunctionArgs {
|
|
14
|
+
readonly feedback: FeedbackProjection | undefined;
|
|
15
|
+
readonly returnQuestion: ReturnQuestionProjection;
|
|
16
|
+
readonly deepestReturnQuestion?: ReturnQuestionProjection;
|
|
17
|
+
}
|
|
18
|
+
interface RecursiveDeepestReturnQuestionWithFeedbackFunction {
|
|
19
|
+
(args: RecursiveDeepestReturnQuestionWithFeedbackFunctionArgs): ReturnQuestionProjection | undefined;
|
|
20
|
+
}
|
|
21
|
+
declare const deepestReturnQuestionWithFeedbackForReturnQuestion: RecursiveDeepestReturnQuestionWithFeedbackFunction;
|
|
22
|
+
export { feedbackForReturnQuestion, deepestReturnQuestionWithFeedbackForReturnQuestion };
|
package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js
CHANGED
|
@@ -7,25 +7,52 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
|
|
|
7
7
|
const returnQuestionId = Object.keys(feedback).find((id) => id === returnQuestion.id);
|
|
8
8
|
if (returnQuestionId) {
|
|
9
9
|
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
10
|
-
if (returnQuestionFeedback
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
];
|
|
19
|
-
}
|
|
20
|
-
return acc;
|
|
10
|
+
if (isUuid(returnQuestionFeedback)) {
|
|
11
|
+
const feebackReturnQuestionChild = returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
12
|
+
if (feebackReturnQuestionChild) {
|
|
13
|
+
return [
|
|
14
|
+
...acc,
|
|
15
|
+
translate(feebackReturnQuestionChild?.name),
|
|
16
|
+
...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
|
|
17
|
+
];
|
|
21
18
|
}
|
|
22
|
-
return
|
|
19
|
+
return acc;
|
|
23
20
|
}
|
|
24
|
-
return acc;
|
|
21
|
+
return [...acc, returnQuestionFeedback];
|
|
25
22
|
}
|
|
26
23
|
return (returnQuestion.children?.reduce((acc, childReturnQuestion) => [
|
|
27
24
|
...acc,
|
|
28
25
|
...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
|
|
29
26
|
], []) || []);
|
|
30
27
|
};
|
|
31
|
-
|
|
28
|
+
const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQuestion, deepestReturnQuestion, }) => {
|
|
29
|
+
if (!feedback) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const returnQuestionId = Object.keys(feedback).find((id) => id === returnQuestion.id);
|
|
33
|
+
if (returnQuestionId) {
|
|
34
|
+
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
35
|
+
if (isUuid(returnQuestionFeedback)) {
|
|
36
|
+
const feebackReturnQuestionChild = returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
37
|
+
if (feebackReturnQuestionChild) {
|
|
38
|
+
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
39
|
+
feedback,
|
|
40
|
+
returnQuestion: feebackReturnQuestionChild,
|
|
41
|
+
deepestReturnQuestion: returnQuestion,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return returnQuestion;
|
|
45
|
+
}
|
|
46
|
+
return returnQuestion;
|
|
47
|
+
}
|
|
48
|
+
const feebackReturnQuestionChild = returnQuestion.children?.find((childReturnQuestion) => Object.keys(feedback).find((id) => id === childReturnQuestion.id));
|
|
49
|
+
if (feebackReturnQuestionChild) {
|
|
50
|
+
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
51
|
+
feedback,
|
|
52
|
+
returnQuestion: feebackReturnQuestionChild,
|
|
53
|
+
deepestReturnQuestion: feebackReturnQuestionChild,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return deepestReturnQuestion;
|
|
57
|
+
};
|
|
58
|
+
export { feedbackForReturnQuestion, deepestReturnQuestionWithFeedbackForReturnQuestion };
|
|
@@ -21,21 +21,21 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
21
21
|
}
|
|
22
22
|
if (!checkoutIntroShown) {
|
|
23
23
|
if (!introRouteMatch) {
|
|
24
|
-
return React.createElement(Navigate, {
|
|
24
|
+
return React.createElement(Navigate, { to: Routes.INTRO, replace: true });
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
if (itemRouteMatch) {
|
|
29
29
|
const checkoutItem = checkout?.items.find((item) => item.id === itemRouteMatch.params.id);
|
|
30
30
|
if (!checkoutItem) {
|
|
31
|
-
return React.createElement(Navigate, {
|
|
31
|
+
return React.createElement(Navigate, { to: Routes.CHECKOUT, replace: true });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
if (firstItemWithoutCustomerDecision && !itemRouteMatch) {
|
|
35
|
-
return React.createElement(Navigate, {
|
|
35
|
+
return React.createElement(Navigate, { to: generatePath(Routes.ITEM, { id: firstItemWithoutCustomerDecision.id }), replace: true });
|
|
36
36
|
}
|
|
37
37
|
if (firstItemWithoutCustomerDecision === undefined && !summaryRouteMatch) {
|
|
38
|
-
return React.createElement(Navigate, {
|
|
38
|
+
return React.createElement(Navigate, { to: Routes.SUMMARY, replace: true });
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return React.createElement(Outlet, null);
|
|
@@ -16,7 +16,7 @@ const Routing = ({ onNotAccessible, customerId, locale, I18n, onI18nError }) =>
|
|
|
16
16
|
children: [
|
|
17
17
|
{
|
|
18
18
|
path: "",
|
|
19
|
-
element: (React.createElement(I18n, {
|
|
19
|
+
element: (React.createElement(I18n, { loader: React.createElement(Spinner, null), locale: locale, onError: onI18nError },
|
|
20
20
|
React.createElement(Outlet, null))),
|
|
21
21
|
children: [
|
|
22
22
|
{
|
|
@@ -52,7 +52,7 @@ const Routing = ({ onNotAccessible, customerId, locale, I18n, onI18nError }) =>
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
path: "*",
|
|
55
|
-
element: React.createElement(Navigate, {
|
|
55
|
+
element: React.createElement(Navigate, { to: Routes.CHECKOUT, replace: true }),
|
|
56
56
|
},
|
|
57
57
|
]);
|
|
58
58
|
return routes;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { style } from "./Error.style";
|
|
4
|
-
const Error = ({ error, style: customStyle }) => (React.createElement(Text, {
|
|
4
|
+
const Error = ({ error, style: customStyle }) => (React.createElement(Text, { level: 2, style: [style.error, customStyle], detail: true }, error));
|
|
5
5
|
export { Error };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { animated, useSpring } from "@react-spring/native";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
4
5
|
import { theme } from "../../../../theme/theme";
|
|
5
6
|
import { style } from "./Field.style";
|
|
6
7
|
const { spaceM } = theme();
|
|
7
8
|
const Field = ({ label, isFocused = false, style: customStyle }) => {
|
|
8
9
|
const springs = useSpring(isFocused ? { scale: 0.75, translateY: -14, translateX: 0 } : { scale: 1, translateY: spaceM, translateX: spaceM });
|
|
9
10
|
return (React.createElement(animated.View, { pointerEvents: "none", style: [
|
|
10
|
-
style.field,
|
|
11
11
|
customStyle?.field,
|
|
12
12
|
{
|
|
13
13
|
transform: [
|
|
@@ -23,6 +23,7 @@ const Field = ({ label, isFocused = false, style: customStyle }) => {
|
|
|
23
23
|
],
|
|
24
24
|
},
|
|
25
25
|
] },
|
|
26
|
-
React.createElement(Text, {
|
|
26
|
+
React.createElement(Text, { level: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
|
|
27
|
+
React.createElement(View, { style: [style.fieldBackground, { opacity: isFocused ? 1 : 0 }] })));
|
|
27
28
|
};
|
|
28
29
|
export { Field };
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
declare const style: {
|
|
2
|
-
|
|
3
|
-
paddingHorizontal: number;
|
|
2
|
+
fieldBackground: {
|
|
4
3
|
backgroundColor: string;
|
|
4
|
+
height: string;
|
|
5
|
+
position: "absolute";
|
|
6
|
+
width: string;
|
|
7
|
+
zIndex: number;
|
|
8
|
+
};
|
|
9
|
+
fieldText: {
|
|
10
|
+
paddingHorizontal: number;
|
|
11
|
+
zIndex: number;
|
|
5
12
|
};
|
|
6
13
|
};
|
|
7
14
|
export { style };
|
|
@@ -2,9 +2,16 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
3
|
const { colorBase, spaceS } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
-
|
|
6
|
-
paddingHorizontal: spaceS,
|
|
5
|
+
fieldBackground: {
|
|
7
6
|
backgroundColor: colorBase,
|
|
7
|
+
height: "100%",
|
|
8
|
+
position: "absolute",
|
|
9
|
+
width: "100%",
|
|
10
|
+
zIndex: 0,
|
|
11
|
+
},
|
|
12
|
+
fieldText: {
|
|
13
|
+
paddingHorizontal: spaceS,
|
|
14
|
+
zIndex: 1,
|
|
8
15
|
},
|
|
9
16
|
});
|
|
10
17
|
export { style };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare const style: {
|
|
2
2
|
icon: {
|
|
3
3
|
fontFamily: string;
|
|
4
|
+
fontSize: number;
|
|
4
5
|
fontStyle: "normal";
|
|
5
6
|
fontWeight: "normal";
|
|
7
|
+
height: number;
|
|
8
|
+
minHeight: number;
|
|
6
9
|
minWidth: number;
|
|
7
10
|
width: number;
|
|
8
|
-
minHeight: number;
|
|
9
|
-
height: number;
|
|
10
|
-
fontSize: number;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export { style };
|
|
@@ -4,13 +4,13 @@ const { iconFamily, iconSize } = theme();
|
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
icon: {
|
|
6
6
|
fontFamily: iconFamily,
|
|
7
|
+
fontSize: iconSize,
|
|
7
8
|
fontStyle: "normal",
|
|
8
9
|
fontWeight: "normal",
|
|
10
|
+
height: iconSize,
|
|
11
|
+
minHeight: iconSize,
|
|
9
12
|
minWidth: iconSize,
|
|
10
13
|
width: iconSize,
|
|
11
|
-
minHeight: iconSize,
|
|
12
|
-
height: iconSize,
|
|
13
|
-
fontSize: iconSize,
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
export { style };
|