@lookiero/checkout 0.2.21 → 0.2.23
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/feedback/feedback.mock.d.ts +3 -0
- package/dist/infrastructure/projection/feedback/feedback.mock.js +6 -0
- package/dist/infrastructure/projection/returnQuestion/returnQuestions.mock.js +1 -1
- package/dist/infrastructure/ui/components/layouts/body/Body.js +4 -7
- package/dist/infrastructure/ui/components/layouts/body/Body.style.d.ts +3 -7
- package/dist/infrastructure/ui/components/layouts/body/Body.style.js +4 -8
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +1 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +1 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +3 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +10 -9
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -10
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -10
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +4 -4
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.d.ts +1 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.js +7 -3
- 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 +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.js +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +27 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.d.ts +10 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.js +13 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +3 -2
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +4 -2
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +13 -4
- package/dist/infrastructure/ui/i18n/i18n.d.ts +5 -2
- package/dist/infrastructure/ui/i18n/i18n.js +4 -1
- package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +1 -1
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +1 -1
- package/dist/infrastructure/ui/routing/Routing.js +21 -14
- package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.style.js +1 -1
- package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.js +1 -1
- package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.style.js +1 -1
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.d.ts +12 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.js +7 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.d.ts +13 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.js +16 -0
- package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.d.ts +1 -1
- package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.js +1 -1
- package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.style.d.ts +4 -1
- package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.style.js +10 -3
- package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.js +1 -1
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.d.ts +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.d.ts +12 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.js +23 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.d.ts +17 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.js +60 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.d.ts +49 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.js +62 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.d.ts +6 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.d.ts +13 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.js +17 -0
- package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.d.ts +2 -2
- package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.style.js +1 -1
- package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.d.ts +1 -1
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.js +7 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.d.ts +7 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.js +10 -0
- package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.d.ts +8 -6
- package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.js +8 -5
- package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.style.d.ts +6 -0
- package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.style.js +8 -2
- package/dist/infrastructure/ui/shared/hooks/useScreenSize.d.ts +4 -0
- package/dist/infrastructure/ui/shared/hooks/useScreenSize.js +9 -0
- package/dist/infrastructure/ui/views/App.d.ts +3 -0
- package/dist/infrastructure/ui/views/App.js +8 -0
- package/dist/infrastructure/ui/views/intro/Intro.js +1 -1
- package/dist/infrastructure/ui/views/item/Item.js +12 -9
- package/dist/infrastructure/ui/views/item/Item.style.d.ts +6 -1
- package/dist/infrastructure/ui/views/item/Item.style.js +7 -2
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +1 -1
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +10 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +32 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +12 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +15 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +17 -9
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +1 -13
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -14
- package/dist/projection/returnQuestion/returnQuestion.d.ts +1 -0
- package/dist/projection/returnQuestion/returnQuestion.js +1 -0
- package/package.json +5 -2
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.d.ts +0 -10
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.js +0 -11
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.js +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.style.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.style.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.style.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.style.js +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.js +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.style.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.js +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.style.d.ts +0 -0
- /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.style.js +0 -0
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
1
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
3
2
|
import React, { useCallback, useState } from "react";
|
|
4
|
-
import { View } from "react-native";
|
|
3
|
+
import { Text, TouchableHighlight, View } from "react-native";
|
|
5
4
|
import { useParams } from "react-router-native";
|
|
6
5
|
import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
7
6
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
7
|
+
import { feedback as feedbackMock } from "../../../projection/feedback/feedback.mock";
|
|
8
8
|
import { returnQuestions as returnQuestionsMock } from "../../../projection/returnQuestion/returnQuestions.mock";
|
|
9
|
-
import { Spinner } from "../../components/atoms/spinner/Spinner";
|
|
10
9
|
import { Body } from "../../components/layouts/body/Body";
|
|
11
10
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
11
|
+
import { Spinner } from "../../shared/components/atoms/spinner/Spinner";
|
|
12
12
|
import { style } from "./Item.style";
|
|
13
13
|
import { ProductVariantDescription } from "./components/productVariantDescription/ProductVariantDescription";
|
|
14
14
|
import { ProductVariantSlider } from "./components/productVariantSlider/ProductVariantSlider";
|
|
15
|
+
import { ReturnQuestionsFeedback } from "./components/returnQuestionsFeedback/ReturnQuestionsFeedback";
|
|
15
16
|
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 = {};
|
|
20
17
|
const Item = ({ customerId }) => {
|
|
21
18
|
const { id } = useParams();
|
|
22
19
|
const [checkout, status] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
23
20
|
const checkoutItem = checkout?.items.find((checkoutItem) => checkoutItem.id === id);
|
|
24
|
-
const [returnQuestionsVisible, setReturnQuestionsVisible] = useState(
|
|
21
|
+
const [returnQuestionsVisible, setReturnQuestionsVisible] = useState(false);
|
|
25
22
|
const handleOnShowReturnQuestions = useCallback(() => setReturnQuestionsVisible(true), []);
|
|
26
23
|
const handleOnHideReturnQuestions = useCallback(() => setReturnQuestionsVisible(false), []);
|
|
24
|
+
const handleOnEditFeedback = useCallback(() => void 0, []);
|
|
27
25
|
if (status === QueryStatus.LOADING)
|
|
28
26
|
return React.createElement(Spinner, null);
|
|
29
27
|
const { price } = checkoutItem;
|
|
30
28
|
const { media, brand, name, size, color } = checkoutItem.productVariant;
|
|
31
29
|
const returnQuestions = returnQuestionsMock;
|
|
30
|
+
const feedback = feedbackMock;
|
|
32
31
|
return (React.createElement(React.Fragment, null,
|
|
33
32
|
React.createElement(SafeAreaScrollView, null,
|
|
34
33
|
React.createElement(Body, null,
|
|
35
34
|
React.createElement(View, { style: style.sliderContainer },
|
|
36
35
|
React.createElement(ProductVariantSlider, { producVariantMedia: media })),
|
|
37
36
|
React.createElement(ProductVariantDescription, { brand: brand, name: name, price: price, size: size, color: color }),
|
|
38
|
-
React.createElement(
|
|
37
|
+
Object.entries(feedback).length !== 0 && (React.createElement(View, { style: style.feedbackContainer },
|
|
38
|
+
React.createElement(ReturnQuestionsFeedback, { feedback: feedback, returnQuestions: returnQuestions, onEditFeedback: handleOnEditFeedback }))),
|
|
39
|
+
React.createElement(View, { style: { flexDirection: "row", justifyContent: "center" } },
|
|
40
|
+
React.createElement(TouchableHighlight, { onPress: handleOnShowReturnQuestions },
|
|
41
|
+
React.createElement(Text, { style: { padding: 16 } }, "show return questions"))))),
|
|
39
42
|
React.createElement(ReturnQuestionsForm, { feedback: feedback, returnQuestions: returnQuestions, visible: returnQuestionsVisible, onClose: handleOnHideReturnQuestions })));
|
|
40
43
|
};
|
|
41
44
|
export { Item };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../theme/theme";
|
|
3
|
-
const { spaceXL } = theme();
|
|
3
|
+
const { borderSize, colorGrayscaleM, spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
sliderContainer: {
|
|
6
|
-
|
|
6
|
+
minHeight: 500,
|
|
7
7
|
marginBottom: spaceXL,
|
|
8
8
|
},
|
|
9
|
+
feedbackContainer: {
|
|
10
|
+
marginVertical: spaceXL,
|
|
11
|
+
borderTopColor: colorGrayscaleM,
|
|
12
|
+
borderTopWidth: borderSize,
|
|
13
|
+
},
|
|
9
14
|
});
|
|
10
15
|
export { style };
|
package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useState } from "react";
|
|
2
2
|
import { Image } from "react-native";
|
|
3
|
-
import { Slider } from "../../../../components/layouts/slider/Slider";
|
|
4
3
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
4
|
+
import { Slider } from "../../../../shared/components/layouts/slider/Slider";
|
|
5
5
|
import { style } from "./ProductVariantSlider.style";
|
|
6
6
|
const ProductVariantSlider = ({ producVariantMedia }) => {
|
|
7
7
|
const cdnImageUrl = useMediaImage();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
interface ReturnQuestionsFeedbackProps {
|
|
5
|
+
readonly feedback: FeedbackProjection;
|
|
6
|
+
readonly returnQuestions: ReturnQuestionProjection[];
|
|
7
|
+
readonly onEditFeedback: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const ReturnQuestionsFeedback: FC<ReturnQuestionsFeedbackProps>;
|
|
10
|
+
export { ReturnQuestionsFeedback };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { 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 { HostDefaultReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem";
|
|
10
|
+
import { ReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem";
|
|
11
|
+
import { I18nMessages, RETURN_QUESTIONS_PREFIX } from "../../../../i18n/i18n";
|
|
12
|
+
import { ButtonIcon } from "../../../../shared/components/molecules/buttonIcon/ButtonIcon";
|
|
13
|
+
import { style } from "./ReturnQuestionsFeedback.style";
|
|
14
|
+
const returnQuestionItems = {
|
|
15
|
+
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionFeedbackItem,
|
|
16
|
+
[ReturnQuestionType.HOST_TEXTAREA]: HostDefaultReturnQuestionFeedbackItem,
|
|
17
|
+
[ReturnQuestionType.HOST_SELECT]: ReturnQuestionFeedbackItem,
|
|
18
|
+
[ReturnQuestionType.HOST_STACK]: ReturnQuestionFeedbackItem,
|
|
19
|
+
[ReturnQuestionType.TEXTAREA]: ReturnQuestionFeedbackItem,
|
|
20
|
+
[ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
|
|
21
|
+
};
|
|
22
|
+
const ReturnQuestionsFeedback = ({ feedback, returnQuestions, onEditFeedback }) => {
|
|
23
|
+
const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE, prefix: RETURN_QUESTIONS_PREFIX });
|
|
24
|
+
return (React.createElement(View, null,
|
|
25
|
+
React.createElement(View, { style: style.titleContainer },
|
|
26
|
+
React.createElement(Text, { level: 2, style: style.title }, titleText),
|
|
27
|
+
React.createElement(ButtonIcon, { name: "pencil", onPress: onEditFeedback })),
|
|
28
|
+
React.createElement(ReturnQuestionFeedbackProvider, { feedback: feedback },
|
|
29
|
+
React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
30
|
+
React.createElement(ReturnQuestions, { returnQuestions: returnQuestions })))));
|
|
31
|
+
};
|
|
32
|
+
export { ReturnQuestionsFeedback };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceL, spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
titleContainer: {
|
|
6
|
+
flexDirection: "row",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
justifyContent: "space-between",
|
|
9
|
+
},
|
|
10
|
+
title: {
|
|
11
|
+
marginTop: spaceXL,
|
|
12
|
+
marginBottom: spaceL,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export { style };
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Modal } from "@lookiero/aurora-next/build/components/molecules/Modal/Modal";
|
|
1
|
+
import { PortalHost } from "@gorhom/portal";
|
|
3
2
|
import React from "react";
|
|
4
3
|
import { ScrollView, View } from "react-native";
|
|
4
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
5
|
import { ReturnQuestionType, } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
6
6
|
import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
|
|
7
7
|
import { ReturnQuestionFeedbackProvider } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
|
|
@@ -11,19 +11,27 @@ import { HostSelectReturnQuestionItem } from "../../../../components/organisms/r
|
|
|
11
11
|
import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem";
|
|
12
12
|
import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
|
|
13
13
|
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
14
|
+
import { Modal } from "../../../../shared/components/layouts/modal/Modal";
|
|
15
|
+
import { theme } from "../../../../theme/theme";
|
|
14
16
|
import { style } from "./ReturnQuestionsForm.style";
|
|
17
|
+
const { spaceXL } = theme();
|
|
18
|
+
const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
|
|
15
19
|
const returnQuestionItems = {
|
|
16
20
|
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionItem,
|
|
21
|
+
[ReturnQuestionType.HOST_TEXTAREA]: HostDefaultReturnQuestionItem,
|
|
17
22
|
[ReturnQuestionType.HOST_SELECT]: HostSelectReturnQuestionItem,
|
|
18
23
|
[ReturnQuestionType.HOST_STACK]: HostStackReturnQuestionItem,
|
|
19
24
|
[ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
|
|
20
25
|
[ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
|
|
21
26
|
};
|
|
22
|
-
const ReturnQuestionsForm = ({ feedback, returnQuestions, onClose, visible }) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
React.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const ReturnQuestionsForm = ({ feedback, returnQuestions, onClose, visible }) => {
|
|
28
|
+
const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
|
|
29
|
+
return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: feedback },
|
|
30
|
+
React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
31
|
+
React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
|
|
32
|
+
React.createElement(Modal, { visible: visible, onClose: onClose, portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME },
|
|
33
|
+
React.createElement(ScrollView, null,
|
|
34
|
+
React.createElement(View, { style: [style.returnQuestionsContainer, { paddingBottom: spaceXL + safeAreaInsetBottom }] },
|
|
35
|
+
React.createElement(ReturnQuestions, { returnQuestions: returnQuestions, portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME })))))));
|
|
36
|
+
};
|
|
29
37
|
export { ReturnQuestionsForm };
|
|
@@ -1,19 +1,7 @@
|
|
|
1
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
2
|
returnQuestionsContainer: {
|
|
16
3
|
paddingBottom: number;
|
|
4
|
+
paddingHorizontal: number;
|
|
17
5
|
};
|
|
18
6
|
};
|
|
19
7
|
export { style };
|
|
@@ -1,22 +1,10 @@
|
|
|
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
|
-
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
5
|
returnQuestionsContainer: {
|
|
19
6
|
paddingBottom: spaceXL,
|
|
7
|
+
paddingHorizontal: spaceXL,
|
|
20
8
|
},
|
|
21
9
|
});
|
|
22
10
|
export { style };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var ReturnQuestionType;
|
|
2
2
|
(function (ReturnQuestionType) {
|
|
3
3
|
ReturnQuestionType["HOST_DEFAULT"] = "HOST_DEFAULT";
|
|
4
|
+
ReturnQuestionType["HOST_TEXTAREA"] = "HOST_TEXTAREA";
|
|
4
5
|
ReturnQuestionType["HOST_SELECT"] = "HOST_SELECT";
|
|
5
6
|
ReturnQuestionType["HOST_STACK"] = "HOST_STACK";
|
|
6
7
|
ReturnQuestionType["TEXTAREA"] = "TEXTAREA";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,14 +20,17 @@
|
|
|
20
20
|
"lint": "eslint --fix --cache --cache-location ./node_modules/.cache/.eslintcache --ext ts,tsx .",
|
|
21
21
|
"format": "prettier --write \"**/*.+(json|css|ts|tsx|md)\"",
|
|
22
22
|
"test": "tsc -p ./tsconfig.test.json --noemit && jest",
|
|
23
|
-
"test:coverage": "jest --coverage --coverageReporters=text --detectOpenHandles --forceExit --silent"
|
|
23
|
+
"test:coverage": "jest --coverage --coverageReporters=text --detectOpenHandles --forceExit --silent",
|
|
24
|
+
"prepare": "husky install"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
27
|
+
"@gorhom/portal": "^1.0.14",
|
|
26
28
|
"@lookiero/i18n": "^0.8.0",
|
|
27
29
|
"@lookiero/i18n-react": "^0.8.0",
|
|
28
30
|
"@lookiero/messaging": "^8.0.0",
|
|
29
31
|
"@lookiero/messaging-react": "^8.0.0",
|
|
30
32
|
"@react-spring/native": "^9.5.5",
|
|
33
|
+
"react-native-safe-area-context": "^4.4.1",
|
|
31
34
|
"react-router-dom": "^6.4.1",
|
|
32
35
|
"react-router-native": "^6.3.0",
|
|
33
36
|
"tiny-invariant": "^1.2.0",
|
|
File without changes
|
|
File without changes
|
/package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.style.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.style.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.style.d.ts
RENAMED
|
File without changes
|
/package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.style.js
RENAMED
|
File without changes
|
/package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.style.d.ts
RENAMED
|
File without changes
|
/package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.style.js
RENAMED
|
File without changes
|