@lookiero/checkout 0.4.6-beta.0 → 0.4.6-beta.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/templates/SafeAreaScrollView.js +1 -1
- package/dist/infrastructure/ui/views/summary/Summary.js +2 -0
- package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +2 -2
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +4 -1
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +2 -1
- package/dist/shared/ui/components/layouts/stack/Stack.js +3 -4
- package/dist/shared/ui/components/molecules/toast/Toast.style.d.ts +1 -0
- package/dist/shared/ui/components/molecules/toast/Toast.style.js +1 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ const SafeAreaScrollView = ({ children, footer, edges = ["top", "bottom", "left"
|
|
|
9
9
|
React.createElement(ScrollView, { contentContainerStyle: [
|
|
10
10
|
{
|
|
11
11
|
paddingTop: safeAreaInsetTop + scrollerPaddingTop,
|
|
12
|
-
paddingBottom: safeAreaInsetBottom + Platform.OS === "android" ? spaceXXXL : 0,
|
|
12
|
+
paddingBottom: safeAreaInsetBottom + (Platform.OS === "android" ? spaceXXXL : 0),
|
|
13
13
|
},
|
|
14
14
|
customStyle?.scrollView,
|
|
15
15
|
] }, children),
|
|
@@ -8,6 +8,7 @@ import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checko
|
|
|
8
8
|
import { useCreateNotification } from "../../../../shared/notifications";
|
|
9
9
|
import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
|
|
10
10
|
import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
|
|
11
|
+
import { Toast, ToastVariant } from "../../../../shared/ui/components/molecules/toast/Toast";
|
|
11
12
|
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
12
13
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
13
14
|
import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
|
|
@@ -55,6 +56,7 @@ const Summary = ({ customerId }) => {
|
|
|
55
56
|
React.createElement(Body, { style: { row: { paddingBottom: pricingHeight || spaceXL } } },
|
|
56
57
|
fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
|
|
57
58
|
React.createElement(View, { style: style.content },
|
|
59
|
+
React.createElement(Toast, { body: "Toast body", title: "Toast title", variant: ToastVariant.ERROR, onClose: () => void 0 }),
|
|
58
60
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
59
61
|
React.createElement(Text, { level: 3, style: style.description, body: true }, descriptionText)),
|
|
60
62
|
React.createElement(CheckoutItemsTabs, { checkoutItemsKept: checkoutItemsKept || [], checkoutItemsReturned: checkoutItemsReturned || [], onPressItem: handleOnPressItem }))));
|
|
@@ -16,8 +16,8 @@ const NotificationItem = ({ notification, onRemove, autoHideTimeout, testID = "n
|
|
|
16
16
|
if (!autoHideTimeout) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const hideTimeout = setTimeout(handleOnClose, autoHideTimeout);
|
|
20
|
-
return () => clearTimeout(hideTimeout);
|
|
19
|
+
// const hideTimeout = setTimeout(handleOnClose, autoHideTimeout);
|
|
20
|
+
// return () => clearTimeout(hideTimeout);
|
|
21
21
|
}, [autoHideTimeout, handleOnClose]);
|
|
22
22
|
return (React.createElement(Toast, { body: body, style: customStyle, testID: testID, title: title, variant: toastVariantForNotificationLevel[notification.level], onClose: handleOnClose }));
|
|
23
23
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
3
3
|
notifications: {
|
|
4
|
+
flexDirection: "column";
|
|
4
5
|
top: number;
|
|
5
6
|
width: string;
|
|
6
7
|
zIndex: number;
|
|
7
8
|
left: number;
|
|
8
9
|
} | {
|
|
10
|
+
flexDirection: "column";
|
|
9
11
|
top: number;
|
|
10
12
|
width: string;
|
|
11
13
|
zIndex: number;
|
|
12
|
-
position: "
|
|
14
|
+
position: "fixed";
|
|
13
15
|
left: number;
|
|
14
16
|
} | {
|
|
17
|
+
flexDirection: "column";
|
|
15
18
|
top: number;
|
|
16
19
|
width: string;
|
|
17
20
|
zIndex: number;
|
|
@@ -7,10 +7,11 @@ const style = StyleSheet.create({
|
|
|
7
7
|
notifications: {
|
|
8
8
|
left: 0,
|
|
9
9
|
...Platform.select({
|
|
10
|
-
web: { position: "
|
|
10
|
+
web: { position: "fixed" },
|
|
11
11
|
ios: { position: "absolute" },
|
|
12
12
|
android: { position: "absolute" },
|
|
13
13
|
}),
|
|
14
|
+
flexDirection: "column",
|
|
14
15
|
top: 0,
|
|
15
16
|
width: "100%",
|
|
16
17
|
zIndex: 20,
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { animated, useTransition } from "@react-spring/native";
|
|
2
|
-
import React, { useCallback, useState
|
|
2
|
+
import React, { useCallback, useState } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { style } from "./Stack.style";
|
|
5
5
|
const Stack = ({ children, style: customStyle }) => {
|
|
6
6
|
const [heights, setHeights] = useState({});
|
|
7
7
|
const handleOnLayout = useCallback((itemKey) => ({ nativeEvent: { layout } }) => setHeights((heights) => ({ ...heights, [itemKey]: layout.height })), []);
|
|
8
|
-
const outState = useMemo(() => ({ opacity: 0, height: 0, translateY: -50 }), []);
|
|
9
8
|
const inState = useCallback((height = 0) => ({ opacity: 1, height, translateY: 0 }), []);
|
|
10
9
|
const transitions = useTransition(children, {
|
|
11
10
|
keys: (item) => `${item.key}`,
|
|
12
11
|
native: true,
|
|
13
|
-
from:
|
|
12
|
+
from: { opacity: 0, height: undefined, translateY: -50 },
|
|
14
13
|
enter: (item) => inState(heights[item.key]),
|
|
15
14
|
update: (item) => inState(heights[item.key]),
|
|
16
|
-
leave:
|
|
15
|
+
leave: { opacity: 0, height: 0, translateY: -50 },
|
|
17
16
|
});
|
|
18
17
|
return (React.createElement(View, { pointerEvents: "box-none", style: [style.stack, customStyle] }, transitions(({ opacity, height, translateY }, item, { phase }) => (React.createElement(animated.View, { key: item.key, testID: "stack-item", style: [
|
|
19
18
|
{
|