@lookiero/checkout 0.4.6-beta.3 → 0.4.6-beta.4
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/header/Header.js +2 -6
- package/dist/infrastructure/ui/views/header/Header.style.d.ts +1 -1
- package/dist/infrastructure/ui/views/header/Header.style.js +1 -1
- package/dist/infrastructure/ui/views/summary/Summary.js +1 -11
- package/dist/shared/ui/components/molecules/toast/Toast.style.d.ts +0 -1
- package/dist/shared/ui/components/molecules/toast/Toast.style.js +0 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
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, { useCallback, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Platform, StatusBar, View } from "react-native";
|
|
5
5
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
6
|
import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
|
|
7
7
|
import { ButtonIcon } from "../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
|
|
@@ -84,11 +84,7 @@ const Header = ({ customerId, menu: Menu, style: customStyle }) => {
|
|
|
84
84
|
header = React.createElement(DefaultHeader, { onOpenMenu: handleOnOpenMenu });
|
|
85
85
|
}
|
|
86
86
|
return (React.createElement(React.Fragment, null,
|
|
87
|
-
React.createElement(SafeAreaView, { edges: ["top"], style: [
|
|
88
|
-
style.container,
|
|
89
|
-
// Platform.OS === "android" && { paddingTop: StatusBar.currentHeight },
|
|
90
|
-
customStyle,
|
|
91
|
-
] }, header),
|
|
87
|
+
React.createElement(SafeAreaView, { edges: ["top"], style: [style.container, Platform.OS === "android" && { paddingTop: StatusBar.currentHeight }, customStyle] }, header),
|
|
92
88
|
React.createElement(Menu, { isVisible: menuVisible, onClose: handleOnCloseMenu })));
|
|
93
89
|
};
|
|
94
90
|
export { Header };
|
|
@@ -6,6 +6,7 @@ declare const style: {
|
|
|
6
6
|
width: number;
|
|
7
7
|
};
|
|
8
8
|
container: {
|
|
9
|
+
backgroundColor: string;
|
|
9
10
|
flexDirection: "row";
|
|
10
11
|
flexGrow: number;
|
|
11
12
|
height: number;
|
|
@@ -13,7 +14,6 @@ declare const style: {
|
|
|
13
14
|
};
|
|
14
15
|
header: {
|
|
15
16
|
alignItems: "center";
|
|
16
|
-
backgroundColor: string;
|
|
17
17
|
flexDirection: "row";
|
|
18
18
|
flexGrow: number;
|
|
19
19
|
flexWrap: "nowrap";
|
|
@@ -9,6 +9,7 @@ const style = StyleSheet.create({
|
|
|
9
9
|
width: spaceXXL,
|
|
10
10
|
},
|
|
11
11
|
container: {
|
|
12
|
+
backgroundColor: colorBase,
|
|
12
13
|
flexDirection: "row",
|
|
13
14
|
flexGrow: 0,
|
|
14
15
|
height: HEADER_HEIGHT,
|
|
@@ -16,7 +17,6 @@ const style = StyleSheet.create({
|
|
|
16
17
|
},
|
|
17
18
|
header: {
|
|
18
19
|
alignItems: "center",
|
|
19
|
-
backgroundColor: colorBase,
|
|
20
20
|
flexDirection: "row",
|
|
21
21
|
flexGrow: 0,
|
|
22
22
|
flexWrap: "nowrap",
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
4
|
-
import React, { useCallback,
|
|
4
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
5
5
|
import { Platform, View } from "react-native";
|
|
6
6
|
import { generatePath, useNavigate } from "react-router-native";
|
|
7
7
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
8
|
-
import { useCreateNotification } from "../../../../shared/notifications";
|
|
9
|
-
import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
|
|
10
8
|
import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
|
|
11
|
-
import { Toast, ToastVariant } from "../../../../shared/ui/components/molecules/toast/Toast";
|
|
12
|
-
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
13
9
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
14
10
|
import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
|
|
15
11
|
import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
|
|
@@ -28,11 +24,6 @@ const { spaceXL } = theme();
|
|
|
28
24
|
const Summary = ({ customerId }) => {
|
|
29
25
|
const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
|
|
30
26
|
const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
|
|
31
|
-
const [create] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID });
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
const i = setInterval(() => create({ bodyI18nKey: "Notification body", level: NotificationLevel.ERROR }), 10000);
|
|
34
|
-
return () => clearInterval(i);
|
|
35
|
-
}, [create]);
|
|
36
27
|
const [pricingHeight, setPricingHeight] = useState(0);
|
|
37
28
|
const handleOnPricingLayout = useCallback(({ height }) => setPricingHeight(height), []);
|
|
38
29
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
@@ -56,7 +47,6 @@ const Summary = ({ customerId }) => {
|
|
|
56
47
|
React.createElement(Body, { style: { row: { paddingBottom: pricingHeight || spaceXL } } },
|
|
57
48
|
fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
|
|
58
49
|
React.createElement(View, { style: style.content },
|
|
59
|
-
React.createElement(Toast, { body: "Toast body", title: "Toast title", variant: ToastVariant.ERROR, onClose: () => void 0 }),
|
|
60
50
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
61
51
|
React.createElement(Text, { level: 3, style: style.description, body: true }, descriptionText)),
|
|
62
52
|
React.createElement(CheckoutItemsTabs, { checkoutItemsKept: checkoutItemsKept || [], checkoutItemsReturned: checkoutItemsReturned || [], onPressItem: handleOnPressItem }))));
|