@lookiero/checkout 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +3 -2
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +3 -1
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +3 -1
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +14 -2
- package/package.json +1 -1
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
CHANGED
|
@@ -33,10 +33,11 @@ const ReturnQuestionsForm = ({ returnQuestions, checkoutItemPrice, productVarian
|
|
|
33
33
|
const handleOnSubmit = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
|
|
34
34
|
return (React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
35
35
|
React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
|
|
36
|
-
React.createElement(Modal, {
|
|
36
|
+
React.createElement(Modal, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, testID: "return-questions-form-modal", visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
37
37
|
React.createElement(View, { style: style.returnQuestionsContainer },
|
|
38
38
|
React.createElement(Text, { level: 2, style: style.title }, titleText),
|
|
39
39
|
React.createElement(ProductVariant, { brand: brand, color: color, country: country, media: media, name: name, price: checkoutItemPrice, size: size }),
|
|
40
|
-
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions })
|
|
40
|
+
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
|
|
41
|
+
React.createElement(Button, { style: style.submit, onPress: handleOnSubmit }, submitButtonText)))));
|
|
41
42
|
};
|
|
42
43
|
export { ReturnQuestionsForm };
|
|
@@ -3,9 +3,11 @@ import { theme } from "../../../../theme/theme";
|
|
|
3
3
|
const { spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
returnQuestionsContainer: {
|
|
6
|
-
paddingBottom: spaceXL,
|
|
7
6
|
paddingHorizontal: spaceXL,
|
|
8
7
|
},
|
|
8
|
+
submit: {
|
|
9
|
+
marginTop: spaceXL,
|
|
10
|
+
},
|
|
9
11
|
title: {
|
|
10
12
|
marginBottom: spaceXL,
|
|
11
13
|
textAlign: "center",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ALIGN, Button, Text } from "@lookiero/aurora";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
-
import React from "react";
|
|
3
|
+
import React, { useEffect, useRef } from "react";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
import { View } from "react-native";
|
|
6
6
|
import { Modal } from "../../../../../ui/components/layouts/modal/Modal";
|
|
@@ -9,7 +9,19 @@ const ModalNotificationItem = ({ visible, notification, onRemove, testID = "moda
|
|
|
9
9
|
const titleText = useI18nMessage({ id: notification.titleI18nKey });
|
|
10
10
|
const bodyText = useI18nMessage({ id: notification.bodyI18nKey });
|
|
11
11
|
const acceptText = useI18nMessage({ id: notification.acceptI18nKey });
|
|
12
|
-
const
|
|
12
|
+
const modalNotificationClosedRef = useRef(false);
|
|
13
|
+
const handleOnClose = useCallback(() => {
|
|
14
|
+
onRemove(notification.id);
|
|
15
|
+
modalNotificationClosedRef.current = true;
|
|
16
|
+
}, [notification.id, onRemove]);
|
|
17
|
+
/**
|
|
18
|
+
* Remove modal notification when this view is unmounted
|
|
19
|
+
*/
|
|
20
|
+
useEffect(() => () => {
|
|
21
|
+
if (!modalNotificationClosedRef.current) {
|
|
22
|
+
onRemove(notification.id);
|
|
23
|
+
}
|
|
24
|
+
}, [notification.id, onRemove]);
|
|
13
25
|
return (React.createElement(Modal, { testID: testID, visible: visible, onClose: handleOnClose },
|
|
14
26
|
React.createElement(View, { style: style.modal },
|
|
15
27
|
React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
|