@lookiero/checkout 0.4.1 → 0.4.2
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/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +1 -2
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +1 -2
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +1 -2
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.d.ts +1 -1
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +3 -3
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +1 -5
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +1 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -3
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +2 -3
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +4 -10
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -2
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +1 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +3 -5
- package/dist/infrastructure/ui/i18n/i18n.d.ts +3 -6
- package/dist/infrastructure/ui/i18n/i18n.js +3 -6
- package/dist/infrastructure/ui/views/App.js +1 -3
- package/dist/infrastructure/ui/views/App.style.d.ts +0 -5
- package/dist/infrastructure/ui/views/App.style.js +0 -7
- package/dist/infrastructure/ui/views/checkout/Checkout.js +2 -1
- package/dist/infrastructure/ui/views/checkout/Checkout.style.d.ts +1 -0
- package/dist/infrastructure/ui/views/checkout/Checkout.style.js +1 -0
- package/dist/infrastructure/ui/views/feedback/Feedback.js +2 -1
- package/dist/infrastructure/ui/views/header/Header.style.d.ts +2 -1
- package/dist/infrastructure/ui/views/header/Header.style.js +3 -2
- package/dist/infrastructure/ui/views/intro/Intro.js +2 -1
- package/dist/infrastructure/ui/views/item/Item.js +6 -3
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +3 -6
- package/dist/infrastructure/ui/views/summary/Summary.js +5 -2
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +2 -2
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +3 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +3 -0
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +9 -4
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +19 -11
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +12 -10
- package/dist/shared/ui/components/layouts/modal/Modal.js +9 -5
- package/dist/shared/ui/components/layouts/modal/Modal.style.d.ts +3 -0
- package/dist/shared/ui/components/layouts/modal/Modal.style.js +1 -0
- package/dist/shared/ui/components/layouts/sticky/Sticky.style.js +1 -1
- package/dist/shared/ui/components/molecules/buttonIcon/ButtonIcon.style.d.ts +1 -0
- package/dist/shared/ui/components/molecules/buttonIcon/ButtonIcon.style.js +1 -0
- package/package.json +2 -2
|
@@ -2,14 +2,13 @@ import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Butt
|
|
|
2
2
|
import { BUTTON_VARIANT } from "@lookiero/aurora-next/build/components/atoms/Button/Button.definition";
|
|
3
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
4
|
import React, { useCallback } from "react";
|
|
5
|
-
import { CHECKOUT_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
6
5
|
import { theme } from "../../../../../theme/theme";
|
|
7
6
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
8
7
|
import { style } from "./ButtonCheckoutQuestionItem.style";
|
|
9
8
|
const { colorAccent, colorBase } = theme();
|
|
10
9
|
const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
11
10
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
12
|
-
const optionText = useI18nMessage({ id: checkoutQuestion.name
|
|
11
|
+
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
13
12
|
const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
|
|
14
13
|
return (React.createElement(Button
|
|
15
14
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
5
4
|
import { style } from "./HostDefaultCheckoutQuestionItem.style";
|
|
6
5
|
const HostDefaultCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
|
|
7
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name
|
|
6
|
+
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
8
7
|
return (React.createElement(React.Fragment, null,
|
|
9
8
|
React.createElement(Text, { level: 3, style: style.title }, titleText),
|
|
10
9
|
children));
|
|
@@ -2,10 +2,9 @@ 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 { View } from "react-native";
|
|
5
|
-
import { CHECKOUT_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
6
5
|
import { style } from "./HostSelectCheckoutQuestionItem.style";
|
|
7
6
|
const HostSelectCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
|
|
8
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name
|
|
7
|
+
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
9
8
|
return (React.createElement(React.Fragment, null,
|
|
10
9
|
React.createElement(Text, { level: 3, style: style.title }, titleText),
|
|
11
10
|
React.createElement(View, { style: style.content }, children)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckoutQuestionItem } from "../CheckoutQuestionItem";
|
|
2
|
-
type IconName = "
|
|
2
|
+
type IconName = "checkout_question.icon.bad" | "checkout_question.icon.regular" | "checkout_question.icon.good";
|
|
3
3
|
declare const IconCheckoutQuestionItem: CheckoutQuestionItem;
|
|
4
4
|
export type { IconName };
|
|
5
5
|
export { IconCheckoutQuestionItem };
|
|
@@ -10,11 +10,11 @@ import { Sad } from "./icons/Sad";
|
|
|
10
10
|
const { colorAccent } = theme();
|
|
11
11
|
const ICON = {
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
-
"
|
|
13
|
+
"checkout_question.icon.bad": Sad,
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
15
|
-
"
|
|
15
|
+
"checkout_question.icon.regular": Normal,
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
|
-
"
|
|
17
|
+
"checkout_question.icon.good": Happy,
|
|
18
18
|
};
|
|
19
19
|
const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
20
20
|
const Icon = ICON[checkoutQuestion.name];
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
4
|
-
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
5
4
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
6
5
|
const TEXTAREA_MIN_HEIGHT = 96;
|
|
7
6
|
const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
8
|
-
const placeholderText = useI18nMessage({
|
|
9
|
-
id: checkoutQuestion.placeholder,
|
|
10
|
-
prefix: RETURN_QUESTIONS_PREFIX,
|
|
11
|
-
});
|
|
7
|
+
const placeholderText = useI18nMessage({ id: checkoutQuestion.placeholder });
|
|
12
8
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
13
9
|
const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
|
|
14
10
|
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
5
4
|
import { style } from "./HostDefaultReturnQuestionItem.style";
|
|
6
5
|
const HostDefaultReturnQuestionItem = ({ returnQuestion, children }) => {
|
|
7
|
-
const titleText = useI18nMessage({ id: returnQuestion.name
|
|
6
|
+
const titleText = useI18nMessage({ id: returnQuestion.name });
|
|
8
7
|
return (React.createElement(React.Fragment, null,
|
|
9
8
|
React.createElement(Text, { level: 3, style: style.title }, titleText),
|
|
10
9
|
children));
|
|
@@ -4,19 +4,18 @@ import { TouchableHighlight, View } from "react-native";
|
|
|
4
4
|
import { Modal } from "../../../../../../../shared/ui/components/layouts/modal/Modal";
|
|
5
5
|
import { ButtonIcon } from "../../../../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
|
|
6
6
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
7
|
-
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
8
7
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
9
8
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
10
9
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
11
10
|
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
12
|
-
const placeholderText = useI18nMessage({ id: returnQuestion.placeholder
|
|
11
|
+
const placeholderText = useI18nMessage({ id: returnQuestion.placeholder });
|
|
13
12
|
const [modalVisible, setModalVisible] = useState(false);
|
|
14
13
|
const handleOnPress = useCallback(() => setModalVisible(true), []);
|
|
15
14
|
const handleOnModalClose = useCallback(() => setModalVisible(false), []);
|
|
16
15
|
const feedback = useReturnQuestionFeedback();
|
|
17
16
|
const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestion.id });
|
|
18
17
|
const intl = useIntl();
|
|
19
|
-
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id:
|
|
18
|
+
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
20
19
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
21
20
|
const deepestReturnQuestionWithFeedback = deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
22
21
|
feedback,
|
|
@@ -3,17 +3,16 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
3
3
|
import { animated, useSpring } from "@react-spring/native";
|
|
4
4
|
import React, { useCallback, useState } from "react";
|
|
5
5
|
import { View } from "react-native";
|
|
6
|
-
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
7
6
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
8
7
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
9
8
|
import { style } from "./HostStackReturnQuestionItem.style";
|
|
10
9
|
const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
11
|
-
const titleText = useI18nMessage({ id: returnQuestion.name
|
|
10
|
+
const titleText = useI18nMessage({ id: returnQuestion.name });
|
|
12
11
|
const { feedback } = useReturnQuestionFeedbackForId({ id: returnQuestion.id });
|
|
13
12
|
const feedbackReturnQuestion = feedback
|
|
14
13
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
15
14
|
: undefined;
|
|
16
|
-
const feedbackText = useI18nMessage({ id: feedbackReturnQuestion?.name
|
|
15
|
+
const feedbackText = useI18nMessage({ id: feedbackReturnQuestion?.name });
|
|
17
16
|
const [stackHeight, setStackHeight] = useState();
|
|
18
17
|
const handleOnLayout = useCallback(({ nativeEvent: { layout: { height }, }, }) => setStackHeight(height), []);
|
|
19
18
|
const stackSyle = useSpring({ height: stackHeight });
|
|
@@ -2,12 +2,11 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
|
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { TouchableHighlight } from "react-native";
|
|
5
|
-
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
6
5
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
7
6
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
8
7
|
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
|
|
9
8
|
const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
|
|
10
|
-
const optionText = useI18nMessage({ id: returnQuestion.name
|
|
9
|
+
const optionText = useI18nMessage({ id: returnQuestion.name });
|
|
11
10
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParentId]);
|
|
12
11
|
return (React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
13
12
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
@@ -2,22 +2,16 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
|
|
|
2
2
|
import { useI18nMessage, useIntl } from "@lookiero/i18n-react";
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
|
-
import { I18nMessages
|
|
5
|
+
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
6
6
|
import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
|
|
7
7
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
8
8
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
9
9
|
const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
|
|
10
|
-
const titleText = useI18nMessage({ id: returnQuestion.name
|
|
11
|
-
const unansweredText = useI18nMessage({
|
|
12
|
-
id: I18nMessages.FEEDBACK_UNANSWERED,
|
|
13
|
-
prefix: RETURN_QUESTIONS_FEEDBACK_PREFIX,
|
|
14
|
-
});
|
|
10
|
+
const titleText = useI18nMessage({ id: returnQuestion.name });
|
|
11
|
+
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
15
12
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
16
13
|
const intl = useIntl();
|
|
17
|
-
const translate = useCallback((returnQuestionName) => intl.formatMessage({
|
|
18
|
-
id: `${RETURN_QUESTIONS_PREFIX}${returnQuestionName}`,
|
|
19
|
-
defaultMessage: returnQuestionName,
|
|
20
|
-
}), [intl]);
|
|
14
|
+
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
21
15
|
const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(" / ");
|
|
22
16
|
return (React.createElement(View, { style: style.container },
|
|
23
17
|
React.createElement(Text, { level: 2, style: style.title, detail: true }, titleText),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
4
|
-
import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
|
|
5
4
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
5
|
const TEXTAREA_MIN_HEIGHT = 96;
|
|
7
6
|
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
|
|
8
|
-
const placeholderText = useI18nMessage({ id: returnQuestion.placeholder
|
|
7
|
+
const placeholderText = useI18nMessage({ id: returnQuestion.placeholder });
|
|
9
8
|
const { feedback, onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
|
|
10
9
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: value }), [onChange, returnQuestionParentId]);
|
|
11
10
|
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
@@ -4,6 +4,7 @@ import { Edge } from "react-native-safe-area-context";
|
|
|
4
4
|
type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
|
|
5
5
|
interface SafeAreaScrollViewProps {
|
|
6
6
|
readonly children: ReactNode;
|
|
7
|
+
readonly scrollerPaddingTop?: number;
|
|
7
8
|
readonly edges?: Edge[];
|
|
8
9
|
readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
|
|
9
10
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollView } from "react-native";
|
|
3
3
|
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
-
|
|
5
|
-
const { spaceXL } = theme();
|
|
6
|
-
const SafeAreaScrollView = ({ children, edges = ["top", "bottom", "left", "right"], style: customStyle, }) => {
|
|
4
|
+
const SafeAreaScrollView = ({ children, edges = ["top", "bottom", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
|
|
7
5
|
const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
|
|
8
6
|
return (React.createElement(SafeAreaView, { edges: edges, style: customStyle?.safeAreaView },
|
|
9
7
|
React.createElement(ScrollView, { contentContainerStyle: [
|
|
10
8
|
{
|
|
11
9
|
// Why did we set this??
|
|
12
|
-
paddingTop:
|
|
13
|
-
paddingBottom:
|
|
10
|
+
paddingTop: safeAreaInsetTop + scrollerPaddingTop,
|
|
11
|
+
paddingBottom: safeAreaInsetBottom,
|
|
14
12
|
},
|
|
15
13
|
customStyle?.scrollView,
|
|
16
14
|
] }, children)));
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const COLOR_I18N_PREFIX = "color.";
|
|
2
|
-
declare const RETURN_QUESTIONS_PREFIX = "return_questions.";
|
|
3
|
-
declare const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
|
|
4
|
-
declare const CHECKOUT_QUESTIONS_PREFIX = "checkout_questions.";
|
|
5
2
|
declare enum I18nMessages {
|
|
6
3
|
INTRO_TITLE = "intro.title",
|
|
7
4
|
INTRO_SUBTITLE = "intro.subtitle",
|
|
@@ -30,8 +27,8 @@ declare enum I18nMessages {
|
|
|
30
27
|
GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION = "get_out_of_checkout_modal.description",
|
|
31
28
|
GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON = "get_out_of_checkout_modal.dismiss_button",
|
|
32
29
|
GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON = "get_out_of_checkout_modal.confirm_button",
|
|
33
|
-
FEEDBACK_TITLE = "feedback.title",
|
|
34
|
-
FEEDBACK_UNANSWERED = "feedback.unanswered",
|
|
30
|
+
FEEDBACK_TITLE = "return_questions_feedback.feedback.title",
|
|
31
|
+
FEEDBACK_UNANSWERED = "return_questions_feedback.feedback.unanswered",
|
|
35
32
|
RETURN_QUESTIONS_TITLE = "return_questions.title",
|
|
36
33
|
RETURN_QUESTIONS_SUBMIT_BUTTON = "return_questions.submit_button",
|
|
37
34
|
SUMMARY_TITLE = "summary.title",
|
|
@@ -62,4 +59,4 @@ declare enum I18nMessages {
|
|
|
62
59
|
HEADER_COMPLETE_CHECKOUT_TITLE = "header.complete_checkout_title",
|
|
63
60
|
FEEDBACK_BUTTON = "feedback.button"
|
|
64
61
|
}
|
|
65
|
-
export { I18nMessages, COLOR_I18N_PREFIX
|
|
62
|
+
export { I18nMessages, COLOR_I18N_PREFIX };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
const COLOR_I18N_PREFIX = "color.";
|
|
2
|
-
const RETURN_QUESTIONS_PREFIX = "return_questions.";
|
|
3
|
-
const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
|
|
4
|
-
const CHECKOUT_QUESTIONS_PREFIX = "checkout_questions.";
|
|
5
2
|
var I18nMessages;
|
|
6
3
|
(function (I18nMessages) {
|
|
7
4
|
I18nMessages["INTRO_TITLE"] = "intro.title";
|
|
@@ -31,8 +28,8 @@ var I18nMessages;
|
|
|
31
28
|
I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION"] = "get_out_of_checkout_modal.description";
|
|
32
29
|
I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON"] = "get_out_of_checkout_modal.dismiss_button";
|
|
33
30
|
I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON"] = "get_out_of_checkout_modal.confirm_button";
|
|
34
|
-
I18nMessages["FEEDBACK_TITLE"] = "feedback.title";
|
|
35
|
-
I18nMessages["FEEDBACK_UNANSWERED"] = "feedback.unanswered";
|
|
31
|
+
I18nMessages["FEEDBACK_TITLE"] = "return_questions_feedback.feedback.title";
|
|
32
|
+
I18nMessages["FEEDBACK_UNANSWERED"] = "return_questions_feedback.feedback.unanswered";
|
|
36
33
|
I18nMessages["RETURN_QUESTIONS_TITLE"] = "return_questions.title";
|
|
37
34
|
I18nMessages["RETURN_QUESTIONS_SUBMIT_BUTTON"] = "return_questions.submit_button";
|
|
38
35
|
I18nMessages["SUMMARY_TITLE"] = "summary.title";
|
|
@@ -63,4 +60,4 @@ var I18nMessages;
|
|
|
63
60
|
I18nMessages["HEADER_COMPLETE_CHECKOUT_TITLE"] = "header.complete_checkout_title";
|
|
64
61
|
I18nMessages["FEEDBACK_BUTTON"] = "feedback.button";
|
|
65
62
|
})(I18nMessages || (I18nMessages = {}));
|
|
66
|
-
export { I18nMessages, COLOR_I18N_PREFIX
|
|
63
|
+
export { I18nMessages, COLOR_I18N_PREFIX };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PortalProvider } from "@gorhom/portal";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { View } from "react-native";
|
|
4
3
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
5
4
|
import { Notifications } from "../../../shared/notifications/infrastructure/ui/views/Notifications";
|
|
6
5
|
import { style } from "./App.style";
|
|
@@ -8,6 +7,5 @@ import { Header } from "./header/Header";
|
|
|
8
7
|
const App = ({ customerId, menu, children }) => (React.createElement(SafeAreaProvider, null,
|
|
9
8
|
React.createElement(Header, { customerId: customerId, menu: menu, style: style.header }),
|
|
10
9
|
React.createElement(Notifications, null),
|
|
11
|
-
React.createElement(PortalProvider, null,
|
|
12
|
-
React.createElement(View, { style: style.body }, children))));
|
|
10
|
+
React.createElement(PortalProvider, null, children)));
|
|
13
11
|
export { App };
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { Platform, StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "../theme/theme";
|
|
3
|
-
const { spaceXXXL } = theme();
|
|
4
2
|
const style = StyleSheet.create({
|
|
5
|
-
body: {
|
|
6
|
-
minHeight: "100%",
|
|
7
|
-
paddingTop: spaceXXXL,
|
|
8
|
-
zIndex: 0,
|
|
9
|
-
},
|
|
10
3
|
header: {
|
|
11
4
|
...Platform.select({
|
|
12
5
|
web: {
|
|
@@ -19,6 +19,7 @@ import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollVie
|
|
|
19
19
|
import { I18nMessages } from "../../i18n/i18n";
|
|
20
20
|
import { Routes } from "../../routing/routes";
|
|
21
21
|
import { useBasePath } from "../../routing/useBasePath";
|
|
22
|
+
import { HEADER_HEIGHT } from "../header/Header.style";
|
|
22
23
|
import { ProductVariant } from "../item/components/productVariant/ProductVariant";
|
|
23
24
|
import { Pricing } from "../summary/components/pricing/Pricing";
|
|
24
25
|
import { style } from "./Checkout.style";
|
|
@@ -86,7 +87,7 @@ const Checkout = ({ customerId, getAuthToken, useRedirect }) => {
|
|
|
86
87
|
return React.createElement(Spinner, null);
|
|
87
88
|
return (React.createElement(React.Fragment, null,
|
|
88
89
|
React.createElement(CheckoutSuccessModal, { visible: success, onDismiss: handleOnSuccessModalDismiss }),
|
|
89
|
-
React.createElement(SafeAreaScrollView,
|
|
90
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
|
|
90
91
|
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
91
92
|
hasReplacedCheckoutItem && (React.createElement(View, { style: style.deliveryBannerContainer },
|
|
92
93
|
React.createElement(DeliveryBanner, null))),
|
|
@@ -7,6 +7,7 @@ import { useListCheckoutQuestionsByCheckoutId } from "../../../projection/checko
|
|
|
7
7
|
import { Body } from "../../components/layouts/body/Body";
|
|
8
8
|
import { CheckoutQuestionFeedbackProvider } from "../../components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionFeedback";
|
|
9
9
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
10
|
+
import { HEADER_HEIGHT } from "../header/Header.style";
|
|
10
11
|
import { style } from "./Feedback.style";
|
|
11
12
|
import { CheckoutQuestionsForm } from "./components/checkoutQuestionsForm/CheckoutQuestionsForm";
|
|
12
13
|
const Feedback = ({ customerId }) => {
|
|
@@ -28,7 +29,7 @@ const Feedback = ({ customerId }) => {
|
|
|
28
29
|
if (!dependenciesLoaded)
|
|
29
30
|
return React.createElement(Spinner, null);
|
|
30
31
|
return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {} },
|
|
31
|
-
React.createElement(SafeAreaScrollView,
|
|
32
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
|
|
32
33
|
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
33
34
|
React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
|
|
34
35
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../theme/theme";
|
|
3
3
|
const { colorBase, spaceXXL, spaceXXXL, spaceS } = theme();
|
|
4
|
+
const HEADER_HEIGHT = spaceXXXL;
|
|
4
5
|
const style = StyleSheet.create({
|
|
5
6
|
buttonIconPlaceholder: {
|
|
6
7
|
height: spaceXXL,
|
|
@@ -9,7 +10,7 @@ const style = StyleSheet.create({
|
|
|
9
10
|
container: {
|
|
10
11
|
backgroundColor: colorBase,
|
|
11
12
|
flex: 1,
|
|
12
|
-
height:
|
|
13
|
+
height: HEADER_HEIGHT,
|
|
13
14
|
paddingHorizontal: spaceS,
|
|
14
15
|
width: "100%",
|
|
15
16
|
},
|
|
@@ -28,4 +29,4 @@ const style = StyleSheet.create({
|
|
|
28
29
|
textTransform: "uppercase",
|
|
29
30
|
},
|
|
30
31
|
});
|
|
31
|
-
export { style };
|
|
32
|
+
export { style, HEADER_HEIGHT };
|
|
@@ -11,6 +11,7 @@ import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checko
|
|
|
11
11
|
import { Body } from "../../components/layouts/body/Body";
|
|
12
12
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
13
13
|
import { I18nMessages } from "../../i18n/i18n";
|
|
14
|
+
import { HEADER_HEIGHT } from "../header/Header.style";
|
|
14
15
|
import { style } from "./Intro.style";
|
|
15
16
|
const Bullet = ({ text }) => (React.createElement(View, { style: style.bullet },
|
|
16
17
|
React.createElement(Icon, { name: "rounded-tick", style: style.tickIcon }),
|
|
@@ -29,7 +30,7 @@ const Intro = ({ customerId }) => {
|
|
|
29
30
|
const [incrementIntroShownCount, incrementIntroShownCountStatus] = useIncrementIntroShownCount();
|
|
30
31
|
if (fiveItemsDiscountStatus === QueryStatus.LOADING)
|
|
31
32
|
return React.createElement(Spinner, null);
|
|
32
|
-
return (React.createElement(SafeAreaScrollView,
|
|
33
|
+
return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
|
|
33
34
|
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
34
35
|
React.createElement(View, { style: style.container },
|
|
35
36
|
React.createElement(View, { style: style.content },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { View } from "react-native";
|
|
3
|
+
import { Platform, View } from "react-native";
|
|
4
4
|
import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
|
|
5
5
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
6
|
import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
@@ -17,6 +17,8 @@ import { ReturnQuestionFeedbackProvider } from "../../components/organisms/retur
|
|
|
17
17
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
18
18
|
import { Routes } from "../../routing/routes";
|
|
19
19
|
import { useBasePath } from "../../routing/useBasePath";
|
|
20
|
+
import { theme } from "../../theme/theme";
|
|
21
|
+
import { HEADER_HEIGHT } from "../header/Header.style";
|
|
20
22
|
import { style } from "./Item.style";
|
|
21
23
|
import { CustomerDecissionBanner } from "./components/banner/CustomerDecissionBanner";
|
|
22
24
|
import { ItemActions } from "./components/itemActions/ItemActions";
|
|
@@ -26,6 +28,7 @@ import { ReturnQuestionsFeedback } from "./components/returnQuestionsFeedback/Re
|
|
|
26
28
|
import { ReturnQuestionsForm } from "./components/returnQuestionsForm/ReturnQuestionsForm";
|
|
27
29
|
import { SizeChangeModal } from "./components/sizeChangeModal/SizeChangeModal";
|
|
28
30
|
import { SizeWithoutStockModal } from "./components/sizeWithoutStockModal/SizeWithoutStockModal";
|
|
31
|
+
const { spaceXL } = theme();
|
|
29
32
|
const Item = ({ customerId }) => {
|
|
30
33
|
const { id } = useParams();
|
|
31
34
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
@@ -133,10 +136,10 @@ const Item = ({ customerId }) => {
|
|
|
133
136
|
return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: checkoutItem.feedbacks || {} },
|
|
134
137
|
React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
|
|
135
138
|
React.createElement(SizeChangeModal, { visible: sizeChangeModalVisible, onDismiss: handleOnHideSizeChangeModal }),
|
|
136
|
-
React.createElement(SafeAreaScrollView,
|
|
139
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT },
|
|
137
140
|
React.createElement(Body, null,
|
|
138
141
|
customerDecissionMade && (React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: handleOnBannerPress })),
|
|
139
|
-
React.createElement(View, { style: [style.container, { paddingBottom: stickyHeight }] },
|
|
142
|
+
React.createElement(View, { style: [style.container, { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight }] },
|
|
140
143
|
React.createElement(View, { style: style.sliderContainer },
|
|
141
144
|
React.createElement(ProductVariantSlider, { producVariantMedia: media })),
|
|
142
145
|
React.createElement(ProductVariantDescription, { brand: brand, color: color, name: name, price: price, size: productVariantSelected.size }),
|
|
@@ -8,7 +8,7 @@ import { ReturnQuestions } from "../../../../components/organisms/returnQuestion
|
|
|
8
8
|
import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
9
9
|
import { HostDefaultReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem";
|
|
10
10
|
import { ReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem";
|
|
11
|
-
import { I18nMessages
|
|
11
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
12
12
|
import { style } from "./ReturnQuestionsFeedback.style";
|
|
13
13
|
const returnQuestionItems = {
|
|
14
14
|
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionFeedbackItem,
|
|
@@ -19,7 +19,7 @@ const returnQuestionItems = {
|
|
|
19
19
|
[ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
|
|
20
20
|
};
|
|
21
21
|
const ReturnQuestionsFeedback = ({ returnQuestions, onEditFeedback }) => {
|
|
22
|
-
const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE
|
|
22
|
+
const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE });
|
|
23
23
|
return (React.createElement(View, null,
|
|
24
24
|
React.createElement(View, { style: style.titleContainer },
|
|
25
25
|
React.createElement(Text, { level: 2, style: style.title }, titleText),
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
CHANGED
|
@@ -14,7 +14,7 @@ import { HostSelectReturnQuestionItem } from "../../../../components/organisms/r
|
|
|
14
14
|
import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem";
|
|
15
15
|
import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
|
|
16
16
|
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
17
|
-
import { I18nMessages
|
|
17
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
18
18
|
import { ProductVariant } from "../productVariant/ProductVariant";
|
|
19
19
|
import { style } from "./ReturnQuestionsForm.style";
|
|
20
20
|
const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
|
|
@@ -27,11 +27,8 @@ const returnQuestionItems = {
|
|
|
27
27
|
[ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
|
|
28
28
|
};
|
|
29
29
|
const ReturnQuestionsForm = ({ returnQuestions, checkoutItemPrice, productVariant, visible, onSubmit, onClose, }) => {
|
|
30
|
-
const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE
|
|
31
|
-
const submitButtonText = useI18nMessage({
|
|
32
|
-
id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON,
|
|
33
|
-
prefix: RETURN_QUESTIONS_PREFIX,
|
|
34
|
-
});
|
|
30
|
+
const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
|
|
31
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
|
|
35
32
|
const { media, brand, name, size, color } = productVariant;
|
|
36
33
|
const feedback = useReturnQuestionFeedback();
|
|
37
34
|
const handleOnSubmit = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
|
|
@@ -14,10 +14,13 @@ import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollVie
|
|
|
14
14
|
import { I18nMessages } from "../../i18n/i18n";
|
|
15
15
|
import { Routes } from "../../routing/routes";
|
|
16
16
|
import { useBasePath } from "../../routing/useBasePath";
|
|
17
|
+
import { theme } from "../../theme/theme";
|
|
18
|
+
import { HEADER_HEIGHT } from "../header/Header.style";
|
|
17
19
|
import { style } from "./Summary.style";
|
|
18
20
|
import { CheckoutItemsTabs } from "./components/checkoutItemsTabs/CheckoutItemsTabs";
|
|
19
21
|
import { FiveItemsDiscountBanner } from "./components/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
|
|
20
22
|
import { StickyPricing } from "./components/stickyPricing/StickyPricing";
|
|
23
|
+
const { spaceXL } = theme();
|
|
21
24
|
const Summary = ({ customerId }) => {
|
|
22
25
|
const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
|
|
23
26
|
const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
|
|
@@ -39,8 +42,8 @@ const Summary = ({ customerId }) => {
|
|
|
39
42
|
if (!dependenciesLoaded)
|
|
40
43
|
return React.createElement(Spinner, null);
|
|
41
44
|
return (React.createElement(React.Fragment, null,
|
|
42
|
-
React.createElement(SafeAreaScrollView, { style: { safeAreaView: style.container } },
|
|
43
|
-
React.createElement(Body,
|
|
45
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT, style: { safeAreaView: style.container } },
|
|
46
|
+
React.createElement(Body, { style: { row: { paddingBottom: spaceXL } } },
|
|
44
47
|
fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
|
|
45
48
|
React.createElement(View, { style: style.content },
|
|
46
49
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js
CHANGED
|
@@ -16,9 +16,9 @@ const CheckoutItemsTabs = ({ checkoutItemsKept, checkoutItemsReturned, onPressIt
|
|
|
16
16
|
const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
|
|
17
17
|
const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
|
|
18
18
|
return (React.createElement(Tabs, { style: { sliderContainer: style.sliderContainer }, tabLabels: [`${keepTabText} (${checkoutItemsKept.length})`, `${returnTabText} (${checkoutItemsReturned.length})`] },
|
|
19
|
-
React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text,
|
|
19
|
+
React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text, { style: style.emptyText }, keepEmptyText)) : (checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
|
|
20
20
|
? checkoutItem.replacedFor
|
|
21
21
|
: checkoutItem.productVariant, onPress: () => handleOnPressItem(checkoutItem.id) }))))),
|
|
22
|
-
React.createElement(React.Fragment, null, checkoutItemsReturned.length === 0 ? (React.createElement(Text,
|
|
22
|
+
React.createElement(React.Fragment, null, checkoutItemsReturned.length === 0 ? (React.createElement(Text, { style: style.emptyText }, returnEmptyText)) : (checkoutItemsReturned.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemProductVariant: checkoutItem.productVariant, checkoutItemStatus: checkoutItem.status, style: { image: style.returnCheckoutItem }, testID: "return-checkout-item", discarded: true, onPress: () => handleOnPressItem(checkoutItem.id) })))))));
|
|
23
23
|
};
|
|
24
24
|
export { CheckoutItemsTabs };
|
|
@@ -3,11 +3,16 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Column } from "../../../../ui/components/layouts/column/Column";
|
|
4
4
|
import { Row } from "../../../../ui/components/layouts/row/Row";
|
|
5
5
|
import { Stack } from "../../../../ui/components/layouts/stack/Stack";
|
|
6
|
+
import { useScreenSize } from "../../../../ui/hooks/useScreenSize";
|
|
6
7
|
import { NotificationItem } from "./NotificationItem";
|
|
7
8
|
import { style } from "./Notifications.style";
|
|
8
9
|
const NOTIFICATIONS_AUTOHIDE_TIMEOUT = 10000;
|
|
9
|
-
const Notifications = ({ notifications = [], onRemove, autoHideTimeout = NOTIFICATIONS_AUTOHIDE_TIMEOUT, }) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const Notifications = ({ notifications = [], onRemove, autoHideTimeout = NOTIFICATIONS_AUTOHIDE_TIMEOUT, }) => {
|
|
11
|
+
const screenSize = useScreenSize();
|
|
12
|
+
const isSmallDevice = screenSize === "S";
|
|
13
|
+
return (React.createElement(View, { pointerEvents: "box-none", style: style.notifications, testID: "notifications" },
|
|
14
|
+
React.createElement(Row, { style: [style.row, isSmallDevice && style.rowSmall] },
|
|
15
|
+
React.createElement(Column, null,
|
|
16
|
+
React.createElement(Stack, null, notifications.map((notification) => (React.createElement(NotificationItem, { key: notification.id, autoHideTimeout: autoHideTimeout, notification: notification, style: { toast: style.toast }, testID: notification.id, onRemove: onRemove }))))))));
|
|
17
|
+
};
|
|
13
18
|
export { Notifications };
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
paddingLeft: number;
|
|
4
|
-
paddingRight: number;
|
|
5
|
-
};
|
|
6
|
-
layoutSmall: {
|
|
7
|
-
paddingLeft: string;
|
|
8
|
-
paddingRight: string;
|
|
9
|
-
};
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
10
3
|
notifications: {
|
|
4
|
+
top: number;
|
|
5
|
+
width: string;
|
|
6
|
+
zIndex: number;
|
|
11
7
|
left: number;
|
|
12
|
-
|
|
8
|
+
} | {
|
|
13
9
|
top: number;
|
|
14
10
|
width: string;
|
|
15
11
|
zIndex: number;
|
|
12
|
+
position: "sticky";
|
|
13
|
+
left: number;
|
|
14
|
+
} | {
|
|
15
|
+
top: number;
|
|
16
|
+
width: string;
|
|
17
|
+
zIndex: number;
|
|
18
|
+
position: "absolute";
|
|
19
|
+
left: number;
|
|
16
20
|
};
|
|
17
21
|
row: {
|
|
18
22
|
flex: number;
|
|
19
23
|
justifyContent: "center";
|
|
20
24
|
};
|
|
25
|
+
rowSmall: {
|
|
26
|
+
paddingLeft: number;
|
|
27
|
+
paddingRight: number;
|
|
28
|
+
};
|
|
21
29
|
toast: {
|
|
22
30
|
marginTop: number;
|
|
23
31
|
};
|
|
24
|
-
}
|
|
32
|
+
}>;
|
|
25
33
|
export { style };
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
1
|
+
import { Platform, StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../../infrastructure/ui/theme/theme";
|
|
3
3
|
const { spaceM } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
paddingRight: 0,
|
|
8
|
-
},
|
|
9
|
-
layoutSmall: {
|
|
10
|
-
paddingLeft: "$spaceM",
|
|
11
|
-
paddingRight: "$spaceM",
|
|
12
|
-
},
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-ignore
|
|
13
7
|
notifications: {
|
|
14
8
|
left: 0,
|
|
15
|
-
|
|
9
|
+
...Platform.select({
|
|
10
|
+
web: { position: "sticky" },
|
|
11
|
+
ios: { position: "absolute" },
|
|
12
|
+
android: { position: "absolute" },
|
|
13
|
+
}),
|
|
16
14
|
top: 0,
|
|
17
15
|
width: "100%",
|
|
18
16
|
zIndex: 20,
|
|
@@ -21,6 +19,10 @@ const style = StyleSheet.create({
|
|
|
21
19
|
flex: 1,
|
|
22
20
|
justifyContent: "center",
|
|
23
21
|
},
|
|
22
|
+
rowSmall: {
|
|
23
|
+
paddingLeft: spaceM,
|
|
24
|
+
paddingRight: spaceM,
|
|
25
|
+
},
|
|
24
26
|
toast: {
|
|
25
27
|
marginTop: spaceM,
|
|
26
28
|
},
|
|
@@ -10,17 +10,19 @@ import { ButtonIcon } from "../../molecules/buttonIcon/ButtonIcon";
|
|
|
10
10
|
import { Row } from "../row/Row";
|
|
11
11
|
import { Sticky } from "../sticky/Sticky";
|
|
12
12
|
import { style } from "./Modal.style";
|
|
13
|
-
const { spaceXXL } = theme();
|
|
13
|
+
const { spaceXL, spaceXXL } = theme();
|
|
14
14
|
const TRANSITION_MODAL_SCALE = 0.9;
|
|
15
15
|
const DEFAULT_SAFEAREA_INSET_TOP = spaceXXL;
|
|
16
|
+
const MODAL_DESKTOP_VERTICAL_PADDING = spaceXXL;
|
|
16
17
|
const Modal = ({ children, visible, header, footer, portalHostName, onClose, showCloseButton = false, size = { M: "2/3", L: "1/3" }, style: customStyle, scroll = false, }) => {
|
|
17
18
|
const { height: screenHeight } = Dimensions.get(Platform.OS === "web" ? "window" : "screen");
|
|
18
19
|
const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
|
|
19
|
-
// On Android safeAreaInsetTop won't return the actual value.
|
|
20
|
-
const screenSizeWithoutInsets = screenHeight - (Platform.OS === "android" ? DEFAULT_SAFEAREA_INSET_TOP : safeAreaInsetTop);
|
|
21
20
|
const screenSize = useScreenSize();
|
|
22
21
|
const isSmallDevice = screenSize === "S";
|
|
23
22
|
const columnSizeForScreenSize = size[screenSize];
|
|
23
|
+
// On Android safeAreaInsetTop won't return the actual value.
|
|
24
|
+
const screenSizeWithoutInsets = screenHeight - (Platform.OS === "android" ? DEFAULT_SAFEAREA_INSET_TOP : safeAreaInsetTop);
|
|
25
|
+
const modalMaxHeight = screenSizeWithoutInsets - (!isSmallDevice ? MODAL_DESKTOP_VERTICAL_PADDING : 0);
|
|
24
26
|
const handleHardwareBackPress = useCallback(() => {
|
|
25
27
|
if (!visible) {
|
|
26
28
|
return;
|
|
@@ -65,7 +67,7 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
|
|
|
65
67
|
{
|
|
66
68
|
opacity: modalOpacity,
|
|
67
69
|
transform: [{ translateY: modalTranslateY }, { scale: modalScale }],
|
|
68
|
-
maxHeight:
|
|
70
|
+
maxHeight: modalMaxHeight,
|
|
69
71
|
},
|
|
70
72
|
customStyle?.modal,
|
|
71
73
|
], onLayout: handleOnModalLayout },
|
|
@@ -73,7 +75,9 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
|
|
|
73
75
|
React.createElement(View, null, header),
|
|
74
76
|
showCloseButton && (React.createElement(ButtonIcon, { name: "close", style: { button: customStyle?.closeButton }, onPress: onClose })))),
|
|
75
77
|
React.createElement(ModalContentView, null,
|
|
76
|
-
React.createElement(View, { style: {
|
|
78
|
+
React.createElement(View, { style: {
|
|
79
|
+
paddingBottom: safeAreaInsetBottom + (Platform.OS === "web" ? spaceXL : footerHeight),
|
|
80
|
+
} }, children)),
|
|
77
81
|
footer && (React.createElement(Sticky, { style: style.stickyFooter, onLayout: handleOnFooterLayout }, footer))))))))));
|
|
78
82
|
};
|
|
79
83
|
export { Modal };
|
|
@@ -29,15 +29,18 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
|
29
29
|
"2/3": ViewStyle;
|
|
30
30
|
container: {
|
|
31
31
|
width: string;
|
|
32
|
+
zIndex: number;
|
|
32
33
|
height: string;
|
|
33
34
|
overflow: "hidden";
|
|
34
35
|
} | {
|
|
35
36
|
width: string;
|
|
37
|
+
zIndex: number;
|
|
36
38
|
position: "fixed";
|
|
37
39
|
height: string;
|
|
38
40
|
overflow: "hidden";
|
|
39
41
|
} | {
|
|
40
42
|
width: string;
|
|
43
|
+
zIndex: number;
|
|
41
44
|
position: "absolute";
|
|
42
45
|
height: string;
|
|
43
46
|
overflow: "hidden";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@react-spring/native": "^9.5.5",
|
|
36
36
|
"inline-style-prefixer": "6.0.1",
|
|
37
37
|
"react-native-safe-area-context": "^4.4.1",
|
|
38
|
-
"react-native-svg": "12.
|
|
38
|
+
"react-native-svg": "^12.1.1",
|
|
39
39
|
"tiny-invariant": "^1.3.1",
|
|
40
40
|
"uuid": "^9.0.0"
|
|
41
41
|
},
|