@lookiero/checkout 0.2.16 → 0.2.18
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/README.md +1 -1
- package/dist/domain/checkoutItem/model/checkoutItem.d.ts +2 -0
- package/dist/domain/checkoutItem/model/currency.d.ts +5 -0
- package/dist/domain/checkoutItem/model/currency.js +6 -0
- package/dist/domain/checkoutItem/model/price.d.ts +10 -0
- package/dist/domain/checkoutItem/model/price.js +1 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutItems.js +3 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +0 -1
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +0 -1
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItems.js +1 -0
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +0 -1
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.js +0 -1
- package/dist/infrastructure/projection/checkout/checkout.js +11 -10
- package/dist/infrastructure/projection/checkout/checkout.mock.d.ts +0 -1
- package/dist/infrastructure/projection/checkout/checkout.mock.js +0 -1
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.d.ts +10 -9
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.js +11 -10
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -1
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.mock.js +5 -5
- package/dist/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +3 -0
- package/dist/infrastructure/projection/returnQuestion/returnQuestions.mock.js +348 -0
- package/dist/infrastructure/ui/components/atoms/modal/Modal.style.d.ts +0 -2
- package/dist/infrastructure/ui/components/atoms/modal/Modal.style.js +0 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +11 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +7 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +4 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback.d.ts +29 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback.js +27 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +18 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +15 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.js +1 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.d.ts +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.js +11 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +30 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +20 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +23 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +33 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.d.ts +17 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.js +20 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +13 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.d.ts +9 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.d.ts +13 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +31 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +6 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +6 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.d.ts +10 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.js +11 -0
- package/dist/infrastructure/ui/i18n/i18n.d.ts +11 -2
- package/dist/infrastructure/ui/i18n/i18n.js +10 -1
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +12 -6
- package/dist/infrastructure/ui/views/intro/Intro.js +3 -2
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -3
- package/dist/infrastructure/ui/views/item/Item.js +26 -7
- package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -7
- package/dist/infrastructure/ui/views/item/Item.style.js +0 -7
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +8 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +32 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +16 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +19 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -2
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +11 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +29 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +19 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +22 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +7 -1
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +4 -2
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +5 -3
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +23 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +13 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +16 -0
- package/dist/infrastructure/ui/views/summary/Summary.js +4 -2
- package/dist/projection/checkoutItem/checkoutItem.d.ts +4 -5
- package/dist/projection/checkoutItem/checkoutItem.js +1 -5
- package/dist/projection/feedback/feedback.d.ts +3 -0
- package/dist/projection/feedback/feedback.js +1 -0
- package/dist/projection/returnQuestion/returnQuestion.d.ts +16 -0
- package/dist/projection/returnQuestion/returnQuestion.js +10 -0
- package/package.json +6 -6
|
@@ -1,22 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
+
import { QueryStatus } from "@lookiero/messaging-react";
|
|
3
|
+
import React, { useCallback, useState } from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
3
5
|
import { useParams } from "react-router-native";
|
|
4
6
|
import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
5
7
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
8
|
+
import { returnQuestions as returnQuestionsMock } from "../../../projection/returnQuestion/returnQuestions.mock";
|
|
9
|
+
import { Spinner } from "../../components/atoms/spinner/Spinner";
|
|
6
10
|
import { Body } from "../../components/layouts/body/Body";
|
|
11
|
+
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
7
12
|
import { style } from "./Item.style";
|
|
8
13
|
import { ProductVariantDescription } from "./components/productVariantDescription/ProductVariantDescription";
|
|
9
14
|
import { ProductVariantSlider } from "./components/productVariantSlider/ProductVariantSlider";
|
|
15
|
+
import { ReturnQuestionsForm } from "./components/returnQuestionsForm/ReturnQuestionsForm";
|
|
16
|
+
// const feedback: FeedbackProjection = {
|
|
17
|
+
// ["bb02cedd-09a7-43ed-8e78-ee5b3ad56914"]: "7f336540-4453-4280-9b5f-3bfd4e03ff25",
|
|
18
|
+
// };
|
|
19
|
+
const feedback = {};
|
|
10
20
|
const Item = ({ customerId }) => {
|
|
11
21
|
const { id } = useParams();
|
|
12
|
-
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
22
|
+
const [checkout, status] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
13
23
|
const checkoutItem = checkout?.items.find((checkoutItem) => checkoutItem.id === id);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
const [returnQuestionsVisible, setReturnQuestionsVisible] = useState(true);
|
|
25
|
+
const handleOnShowReturnQuestions = useCallback(() => setReturnQuestionsVisible(true), []);
|
|
26
|
+
const handleOnHideReturnQuestions = useCallback(() => setReturnQuestionsVisible(false), []);
|
|
27
|
+
if (status === QueryStatus.LOADING)
|
|
28
|
+
return React.createElement(Spinner, null);
|
|
29
|
+
const { price } = checkoutItem;
|
|
30
|
+
const { media, brand, name, size, color } = checkoutItem.productVariant;
|
|
31
|
+
const returnQuestions = returnQuestionsMock;
|
|
32
|
+
return (React.createElement(React.Fragment, null,
|
|
33
|
+
React.createElement(SafeAreaScrollView, null,
|
|
17
34
|
React.createElement(Body, null,
|
|
18
35
|
React.createElement(View, { style: style.sliderContainer },
|
|
19
36
|
React.createElement(ProductVariantSlider, { producVariantMedia: media })),
|
|
20
|
-
React.createElement(ProductVariantDescription, { brand: brand, name: name, price: price, size: size, color: color })
|
|
37
|
+
React.createElement(ProductVariantDescription, { brand: brand, name: name, price: price, size: size, color: color }),
|
|
38
|
+
React.createElement(Button, { onPress: handleOnShowReturnQuestions }, "show return questions"))),
|
|
39
|
+
React.createElement(ReturnQuestionsForm, { feedback: feedback, returnQuestions: returnQuestions, visible: returnQuestionsVisible, onClose: handleOnHideReturnQuestions })));
|
|
21
40
|
};
|
|
22
41
|
export { Item };
|
|
@@ -2,13 +2,6 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "../../theme/theme";
|
|
3
3
|
const { spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
-
container: {
|
|
6
|
-
flex: 1,
|
|
7
|
-
},
|
|
8
|
-
scrollContainer: {
|
|
9
|
-
flex: 1,
|
|
10
|
-
flexGrow: 1,
|
|
11
|
-
},
|
|
12
5
|
sliderContainer: {
|
|
13
6
|
flex: 1,
|
|
14
7
|
marginBottom: spaceXL,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
interface GetOutOfCheckoutModalProps {
|
|
3
|
+
readonly visible: boolean;
|
|
4
|
+
readonly onDismiss: () => void;
|
|
5
|
+
readonly onConfirm: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps>;
|
|
8
|
+
export { GetOutOfCheckoutModal };
|
package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
+
import { BUTTON_VARIANT } from "@lookiero/aurora-next/build/components/atoms/Button/Button.definition";
|
|
3
|
+
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
4
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Modal } from "../../../../components/atoms/modal/Modal";
|
|
7
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
|
+
import { style } from "./GetOutOfCheckoutModal.style";
|
|
9
|
+
const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
|
|
10
|
+
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
11
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
12
|
+
const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
|
|
13
|
+
const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
|
|
14
|
+
return (React.createElement(Modal, { visible: visible },
|
|
15
|
+
React.createElement(Text, { body: true, level: 1, style: style.modalTitle }, titleText),
|
|
16
|
+
React.createElement(Text, { body: true, level: 3, style: style.modalDescription }, descriptionText),
|
|
17
|
+
React.createElement(Button
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
, {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
style: style.button, onPress: onDismiss }, dismissButtonText),
|
|
24
|
+
React.createElement(Button
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
, {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
style: [style.button, style.confirmButton], variant: BUTTON_VARIANT.SECONDARY, onPress: onConfirm }, confirmButtonText)));
|
|
31
|
+
};
|
|
32
|
+
export { GetOutOfCheckoutModal };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
modalTitle: {
|
|
3
|
+
textAlign: "center";
|
|
4
|
+
};
|
|
5
|
+
modalDescription: {
|
|
6
|
+
marginVertical: number;
|
|
7
|
+
textAlign: "center";
|
|
8
|
+
};
|
|
9
|
+
button: {
|
|
10
|
+
flex: number;
|
|
11
|
+
};
|
|
12
|
+
confirmButton: {
|
|
13
|
+
marginTop: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export { style };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
modalTitle: {
|
|
6
|
+
textAlign: "center",
|
|
7
|
+
},
|
|
8
|
+
modalDescription: {
|
|
9
|
+
marginVertical: spaceXL,
|
|
10
|
+
textAlign: "center",
|
|
11
|
+
},
|
|
12
|
+
button: {
|
|
13
|
+
flex: 0,
|
|
14
|
+
},
|
|
15
|
+
confirmButton: {
|
|
16
|
+
marginTop: spaceXL,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export { style };
|
|
@@ -3,12 +3,13 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
6
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
6
|
+
import { COLOR_I18N_PREFIX, I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./ProductVariantDescription.style";
|
|
8
8
|
const ProductVariantDescription = ({ brand, name, price, size, color }) => {
|
|
9
9
|
const sizeText = useI18nMessage({ id: I18nMessages.ITEM_SIZE });
|
|
10
10
|
const colorText = useI18nMessage({ id: I18nMessages.ITEM_COLOR });
|
|
11
11
|
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
12
|
+
const colorLabel = useI18nMessage({ id: color.label, prefix: COLOR_I18N_PREFIX });
|
|
12
13
|
return (React.createElement(View, { style: style.container },
|
|
13
14
|
React.createElement(Text, { detail: true, level: 3, style: style.brand }, brand),
|
|
14
15
|
React.createElement(Text, { body: true, level: 2, style: style.name }, name),
|
|
@@ -20,6 +21,6 @@ const ProductVariantDescription = ({ brand, name, price, size, color }) => {
|
|
|
20
21
|
React.createElement(Text, { detail: true, level: 2 },
|
|
21
22
|
colorText,
|
|
22
23
|
": ",
|
|
23
|
-
React.createElement(Text, { style: style.text },
|
|
24
|
+
React.createElement(Text, { style: style.text }, colorLabel))));
|
|
24
25
|
};
|
|
25
26
|
export { ProductVariantDescription };
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
interface ReturnQuestionsFormProps {
|
|
5
|
+
readonly visible: boolean;
|
|
6
|
+
readonly feedback: FeedbackProjection;
|
|
7
|
+
readonly returnQuestions: ReturnQuestionProjection[];
|
|
8
|
+
readonly onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const ReturnQuestionsForm: FC<ReturnQuestionsFormProps>;
|
|
11
|
+
export { ReturnQuestionsForm };
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ButtonIcon } from "@lookiero/aurora-next/build/components/atoms/ButtonIcon/ButtonIcon";
|
|
2
|
+
import { Modal } from "@lookiero/aurora-next/build/components/molecules/Modal/Modal";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { ScrollView, View } from "react-native";
|
|
5
|
+
import { ReturnQuestionType, } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
6
|
+
import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
|
|
7
|
+
import { ReturnQuestionFeedbackProvider } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
|
|
8
|
+
import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
9
|
+
import { HostDefaultReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem";
|
|
10
|
+
import { HostSelectReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem";
|
|
11
|
+
import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem";
|
|
12
|
+
import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
|
|
13
|
+
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
14
|
+
import { style } from "./ReturnQuestionsForm.style";
|
|
15
|
+
const returnQuestionItems = {
|
|
16
|
+
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionItem,
|
|
17
|
+
[ReturnQuestionType.HOST_SELECT]: HostSelectReturnQuestionItem,
|
|
18
|
+
[ReturnQuestionType.HOST_STACK]: HostStackReturnQuestionItem,
|
|
19
|
+
[ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
|
|
20
|
+
[ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
|
|
21
|
+
};
|
|
22
|
+
const ReturnQuestionsForm = ({ feedback, returnQuestions, onClose, visible }) => (React.createElement(ReturnQuestionFeedbackProvider, { feedback: feedback },
|
|
23
|
+
React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
24
|
+
React.createElement(Modal, { style: style.modal, fullHeight: true, size: "1/2", isVisible: visible },
|
|
25
|
+
React.createElement(ButtonIcon, { name: "close", style: style.backButton, onPress: onClose }),
|
|
26
|
+
React.createElement(ScrollView, { contentContainerStyle: style.scrollContainer, showsVerticalScrollIndicator: false },
|
|
27
|
+
React.createElement(View, { style: style.returnQuestionsContainer },
|
|
28
|
+
React.createElement(ReturnQuestions, { returnQuestions: returnQuestions })))))));
|
|
29
|
+
export { ReturnQuestionsForm };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
scrollContainer: {
|
|
3
|
+
flex: number;
|
|
4
|
+
flexGrow: number;
|
|
5
|
+
};
|
|
6
|
+
modal: {
|
|
7
|
+
zIndex: number;
|
|
8
|
+
};
|
|
9
|
+
backButton: {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
alignSelf: "flex-end";
|
|
13
|
+
zIndex: number;
|
|
14
|
+
};
|
|
15
|
+
returnQuestionsContainer: {
|
|
16
|
+
paddingBottom: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export { style };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceM, spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
scrollContainer: {
|
|
6
|
+
flex: 1,
|
|
7
|
+
flexGrow: 1,
|
|
8
|
+
},
|
|
9
|
+
modal: {
|
|
10
|
+
zIndex: 1,
|
|
11
|
+
},
|
|
12
|
+
backButton: {
|
|
13
|
+
top: -spaceXL,
|
|
14
|
+
right: -spaceM,
|
|
15
|
+
alignSelf: "flex-end",
|
|
16
|
+
zIndex: 20,
|
|
17
|
+
},
|
|
18
|
+
returnQuestionsContainer: {
|
|
19
|
+
paddingBottom: spaceXL,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
export { style };
|
|
@@ -12,6 +12,12 @@ const SizeChangeModal = ({ visible, onDismiss }) => {
|
|
|
12
12
|
return (React.createElement(Modal, { visible: visible },
|
|
13
13
|
React.createElement(Text, { body: true, level: 1, style: style.modalTitle }, titleText),
|
|
14
14
|
React.createElement(Text, { body: true, level: 3, style: style.modalDescription }, descriptionText),
|
|
15
|
-
React.createElement(Button
|
|
15
|
+
React.createElement(Button
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
, {
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
style: style.button, onPress: onDismiss }, buttonText)));
|
|
16
22
|
};
|
|
17
23
|
export { SizeChangeModal };
|
package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
declare const style: {
|
|
2
2
|
modalTitle: {
|
|
3
|
-
marginBottom: number;
|
|
4
3
|
textAlign: "center";
|
|
5
4
|
};
|
|
6
5
|
modalDescription: {
|
|
7
|
-
|
|
6
|
+
marginVertical: number;
|
|
8
7
|
textAlign: "center";
|
|
9
8
|
};
|
|
9
|
+
button: {
|
|
10
|
+
flex: number;
|
|
11
|
+
};
|
|
10
12
|
};
|
|
11
13
|
export { style };
|
package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const {
|
|
3
|
+
const { spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
modalTitle: {
|
|
6
|
-
marginBottom: spaceXL,
|
|
7
6
|
textAlign: "center",
|
|
8
7
|
},
|
|
9
8
|
modalDescription: {
|
|
10
|
-
|
|
9
|
+
marginVertical: spaceXL,
|
|
11
10
|
textAlign: "center",
|
|
12
11
|
},
|
|
12
|
+
button: {
|
|
13
|
+
flex: 0,
|
|
14
|
+
},
|
|
13
15
|
});
|
|
14
16
|
export { style };
|
package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
+
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
3
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Modal } from "../../../../components/atoms/modal/Modal";
|
|
6
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
|
+
import { style } from "./SizeWithoutStockModal.style";
|
|
8
|
+
const SizeWithoutStockModal = ({ visible, onDismiss }) => {
|
|
9
|
+
const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
|
|
10
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
|
|
11
|
+
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
12
|
+
return (React.createElement(Modal, { visible: visible },
|
|
13
|
+
React.createElement(Text, { body: true, level: 1, style: style.modalTitle }, titleText),
|
|
14
|
+
React.createElement(Text, { body: true, level: 3, style: style.modalDescription }, descriptionText),
|
|
15
|
+
React.createElement(Button
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
, {
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
style: style.button, onPress: onDismiss }, buttonText)));
|
|
22
|
+
};
|
|
23
|
+
export { SizeWithoutStockModal };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
modalTitle: {
|
|
6
|
+
textAlign: "center",
|
|
7
|
+
},
|
|
8
|
+
modalDescription: {
|
|
9
|
+
marginVertical: spaceXL,
|
|
10
|
+
textAlign: "center",
|
|
11
|
+
},
|
|
12
|
+
button: {
|
|
13
|
+
flex: 0,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export { style };
|
|
@@ -2,10 +2,12 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
|
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { StyleSheet, View } from "react-native";
|
|
5
|
+
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
5
6
|
const Summary = () => {
|
|
6
7
|
const summaryText = useI18nMessage({ id: "summary" });
|
|
7
|
-
return (React.createElement(
|
|
8
|
-
React.createElement(
|
|
8
|
+
return (React.createElement(SafeAreaScrollView, null,
|
|
9
|
+
React.createElement(View, { style: styles.container },
|
|
10
|
+
React.createElement(Text, { heading: true, level: 3 }, summaryText))));
|
|
9
11
|
};
|
|
10
12
|
const styles = StyleSheet.create({
|
|
11
13
|
container: {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
2
|
+
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
3
|
+
import { FeedbackProjection } from "../feedback/feedback";
|
|
2
4
|
declare enum MediaPerspective {
|
|
3
5
|
BACK = "BACK",
|
|
4
6
|
BOTTOM_UP = "BOTTOM_UP",
|
|
@@ -18,10 +20,6 @@ interface MediaProjection {
|
|
|
18
20
|
readonly url: string;
|
|
19
21
|
readonly perspective: MediaPerspective;
|
|
20
22
|
}
|
|
21
|
-
declare enum Currency {
|
|
22
|
-
EUR = "EUR",
|
|
23
|
-
GBP = "GBP"
|
|
24
|
-
}
|
|
25
23
|
interface PriceProjection {
|
|
26
24
|
readonly amount: number;
|
|
27
25
|
readonly currency: Currency;
|
|
@@ -48,15 +46,16 @@ interface CheckoutItemProductVariantProjection {
|
|
|
48
46
|
readonly media: MediaProjection[];
|
|
49
47
|
readonly brand: string;
|
|
50
48
|
readonly name: string;
|
|
51
|
-
readonly price: PriceProjection;
|
|
52
49
|
readonly size: SizeProjection;
|
|
53
50
|
readonly color: ColorProjection;
|
|
54
51
|
}
|
|
55
52
|
interface CheckoutItemProjection {
|
|
56
53
|
readonly id: string;
|
|
57
54
|
readonly status: CheckoutItemStatus;
|
|
55
|
+
readonly price: PriceProjection;
|
|
58
56
|
readonly replacedFor?: string;
|
|
59
57
|
readonly productVariant: CheckoutItemProductVariantProjection;
|
|
58
|
+
readonly feedback: FeedbackProjection | undefined;
|
|
60
59
|
}
|
|
61
60
|
export type { CheckoutItemProjection, CheckoutItemProductVariantProjection, ColorProjection, MediaProjection, PriceProjection, SizeProjection, };
|
|
62
61
|
export { Currency, MediaPerspective };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
1
2
|
var MediaPerspective;
|
|
2
3
|
(function (MediaPerspective) {
|
|
3
4
|
MediaPerspective["BACK"] = "BACK";
|
|
@@ -13,9 +14,4 @@ var MediaPerspective;
|
|
|
13
14
|
MediaPerspective["OTHER"] = "OTHER";
|
|
14
15
|
MediaPerspective["SIDE"] = "SIDE";
|
|
15
16
|
})(MediaPerspective || (MediaPerspective = {}));
|
|
16
|
-
var Currency;
|
|
17
|
-
(function (Currency) {
|
|
18
|
-
Currency["EUR"] = "EUR";
|
|
19
|
-
Currency["GBP"] = "GBP";
|
|
20
|
-
})(Currency || (Currency = {}));
|
|
21
17
|
export { Currency, MediaPerspective };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare enum ReturnQuestionType {
|
|
2
|
+
HOST_DEFAULT = "HOST_DEFAULT",
|
|
3
|
+
HOST_SELECT = "HOST_SELECT",
|
|
4
|
+
HOST_STACK = "HOST_STACK",
|
|
5
|
+
TEXTAREA = "TEXTAREA",
|
|
6
|
+
OPTION = "OPTION"
|
|
7
|
+
}
|
|
8
|
+
interface ReturnQuestionProjection {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
type: ReturnQuestionType;
|
|
13
|
+
children?: ReturnQuestionProjection[];
|
|
14
|
+
}
|
|
15
|
+
export { ReturnQuestionType };
|
|
16
|
+
export type { ReturnQuestionProjection };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var ReturnQuestionType;
|
|
2
|
+
(function (ReturnQuestionType) {
|
|
3
|
+
ReturnQuestionType["HOST_DEFAULT"] = "HOST_DEFAULT";
|
|
4
|
+
ReturnQuestionType["HOST_SELECT"] = "HOST_SELECT";
|
|
5
|
+
ReturnQuestionType["HOST_STACK"] = "HOST_STACK";
|
|
6
|
+
ReturnQuestionType["TEXTAREA"] = "TEXTAREA";
|
|
7
|
+
ReturnQuestionType["OPTION"] = "OPTION";
|
|
8
|
+
// ICON = "ICON",
|
|
9
|
+
})(ReturnQuestionType || (ReturnQuestionType = {}));
|
|
10
|
+
export { ReturnQuestionType };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"@lookiero/i18n-react": "^0.8.0",
|
|
28
28
|
"@lookiero/messaging": "^8.0.0",
|
|
29
29
|
"@lookiero/messaging-react": "^8.0.0",
|
|
30
|
-
"react-native-get-random-values": "^1.8.0",
|
|
31
30
|
"react-router-dom": "^6.4.1",
|
|
32
31
|
"react-router-native": "^6.3.0",
|
|
33
32
|
"tiny-invariant": "^1.2.0",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"@lookiero/aurora-next": "^3.0.181",
|
|
38
37
|
"react": "^18.0.0",
|
|
39
38
|
"react-dom": "^18.0.0",
|
|
40
|
-
"react-native": "^0.
|
|
39
|
+
"react-native": "^0.70.1",
|
|
41
40
|
"react-native-web": "^0.18.9"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"@testing-library/react-hooks": "^8.0.1",
|
|
51
50
|
"@testing-library/react-native": "^11.0.0",
|
|
52
51
|
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
|
|
53
|
-
"@types/jest": "^
|
|
52
|
+
"@types/jest": "^29.1.0",
|
|
54
53
|
"@types/react": "~18.0.0",
|
|
55
54
|
"@types/react-dom": "~18.0.0",
|
|
56
55
|
"@types/react-native": "~0.69.1",
|
|
@@ -67,14 +66,15 @@
|
|
|
67
66
|
"expo": "~46.0.8",
|
|
68
67
|
"expo-status-bar": "~1.4.0",
|
|
69
68
|
"husky": "^8.0.1",
|
|
70
|
-
"jest": "^
|
|
69
|
+
"jest": "^29.1.1",
|
|
71
70
|
"jest-expo": "^46.0.1",
|
|
72
71
|
"jest-mock-extended": "^2.0.7",
|
|
73
72
|
"lint-staged": "^13.0.3",
|
|
74
73
|
"prettier": "^2.7.1",
|
|
75
74
|
"react": "^18.0.0",
|
|
76
75
|
"react-dom": "^18.0.0",
|
|
77
|
-
"react-native": "^0.
|
|
76
|
+
"react-native": "^0.70.1",
|
|
77
|
+
"react-native-get-random-values": "^1.8.0",
|
|
78
78
|
"react-native-web": "^0.18.9",
|
|
79
79
|
"react-test-renderer": "^18.0.0",
|
|
80
80
|
"typescript": "^4.6.3",
|