@lookiero/checkout 0.8.28 → 1.0.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/Item.js +3 -2
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.d.ts +0 -1
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +4 -10
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.d.ts +2 -8
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.js +2 -8
- package/dist/shared/ui/components/atoms/spinner/Spinner.d.ts +1 -6
- package/dist/shared/ui/components/atoms/spinner/Spinner.js +4 -5
- package/package.json +3 -3
|
@@ -160,7 +160,8 @@ const Item = ({ customerId, country }) => {
|
|
|
160
160
|
dependenciesLoadedStatuses.includes(sizeChangeEnabledStatus) &&
|
|
161
161
|
// This will ensure that the view is not shown until bookCheckoutBooking use-case is dispatched (if required)
|
|
162
162
|
(isBookingRequired ? checkout?.checkoutBookingId && bookedProductsVariants : true) &&
|
|
163
|
-
(dependenciesLoadedStatuses.includes(checkoutStatus) || checkout)
|
|
163
|
+
(dependenciesLoadedStatuses.includes(checkoutStatus) || checkout) &&
|
|
164
|
+
resetCheckoutItemStatus !== CommandStatus.LOADING;
|
|
164
165
|
if (!dependenciesLoaded)
|
|
165
166
|
return React.createElement(Spinner, null);
|
|
166
167
|
const { price } = checkoutItem;
|
|
@@ -169,7 +170,7 @@ const Item = ({ customerId, country }) => {
|
|
|
169
170
|
React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
|
|
170
171
|
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, footer: !customerDecissionMade && (React.createElement(ItemActions, { country: country, keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants, returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })) },
|
|
171
172
|
React.createElement(Body, null,
|
|
172
|
-
customerDecissionMade && (React.createElement(CustomerDecissionBanner, {
|
|
173
|
+
customerDecissionMade && (React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: handleOnPressCustomerDecissionBanner })),
|
|
173
174
|
React.createElement(View, { style: [style.content, { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight }] },
|
|
174
175
|
React.createElement(View, { style: style.sliderContainer },
|
|
175
176
|
React.createElement(ProductVariantSlider, { producVariantMedia: media, onChanged: handleOnChangedProductVariantSlider })),
|
|
@@ -4,7 +4,6 @@ type CustomerDecissionBannerStatus = Exclude<CheckoutItemStatus, CheckoutItemSta
|
|
|
4
4
|
interface CustomerDecissionBannerProps {
|
|
5
5
|
readonly checkoutItemStatus: CustomerDecissionBannerStatus;
|
|
6
6
|
readonly onPress: () => void;
|
|
7
|
-
readonly changingDecission: boolean;
|
|
8
7
|
}
|
|
9
8
|
declare const CustomerDecissionBanner: FC<CustomerDecissionBannerProps>;
|
|
10
9
|
export type { CustomerDecissionBannerStatus };
|
|
@@ -1,27 +1,21 @@
|
|
|
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 { Pressable
|
|
4
|
+
import { Pressable } from "react-native";
|
|
5
5
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
|
-
import { Spinner } from "../../../../../../shared/ui/components/atoms/spinner/Spinner";
|
|
7
6
|
import { Banner } from "../../../../components/layouts/banner/Banner";
|
|
8
7
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
9
|
-
import { theme } from "../../../../theme/theme";
|
|
10
8
|
import { style } from "./CustomerDecissionBanner.style";
|
|
11
|
-
const { colorContent } = theme();
|
|
12
9
|
const i18nMessageForCheckoutItemStatus = {
|
|
13
10
|
[CheckoutItemStatus.KEPT]: I18nMessages.ITEM_BANNER_CUSTOMER_KEPT_DECISSION,
|
|
14
11
|
[CheckoutItemStatus.REPLACED]: I18nMessages.ITEM_BANNER_CUSTOMER_REPLACED_DECISSION,
|
|
15
12
|
[CheckoutItemStatus.RETURNED]: I18nMessages.ITEM_BANNER_CUSTOMER_RETURNED_DECISSION,
|
|
16
13
|
};
|
|
17
|
-
const CustomerDecissionBanner = ({ checkoutItemStatus, onPress
|
|
14
|
+
const CustomerDecissionBanner = ({ checkoutItemStatus, onPress }) => {
|
|
18
15
|
const decissionText = useI18nMessage({ id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] }) || "";
|
|
19
16
|
const bannerButtonText = useI18nMessage({ id: I18nMessages.ITEM_BANNER_BUTTON });
|
|
20
17
|
return (React.createElement(Banner, { text: decissionText },
|
|
21
|
-
React.createElement(
|
|
22
|
-
React.createElement(
|
|
23
|
-
React.createElement(Pressable, { onPress: changingDecission ? undefined : onPress },
|
|
24
|
-
React.createElement(Text, { level: 2, style: style.buttonText, detail: true }, bannerButtonText)),
|
|
25
|
-
React.createElement(View, { style: style.placeholder }, changingDecission && React.createElement(Spinner, { color: colorContent, size: 20 })))));
|
|
18
|
+
React.createElement(Pressable, { style: style.button, onPress: onPress },
|
|
19
|
+
React.createElement(Text, { level: 2, style: style.buttonText, detail: true }, bannerButtonText))));
|
|
26
20
|
};
|
|
27
21
|
export { CustomerDecissionBanner };
|
package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.d.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
declare const style: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
justifyContent: "space-between";
|
|
2
|
+
button: {
|
|
3
|
+
alignItems: "center";
|
|
5
4
|
marginTop: number;
|
|
6
|
-
minHeight: number;
|
|
7
|
-
width: string;
|
|
8
5
|
};
|
|
9
6
|
buttonText: {
|
|
10
7
|
textDecorationLine: "underline";
|
|
11
8
|
};
|
|
12
|
-
placeholder: {
|
|
13
|
-
width: number;
|
|
14
|
-
};
|
|
15
9
|
};
|
|
16
10
|
export { style };
|
package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.js
CHANGED
|
@@ -2,18 +2,12 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
3
|
const { spaceM } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
justifyContent: "space-between",
|
|
5
|
+
button: {
|
|
6
|
+
alignItems: "center",
|
|
8
7
|
marginTop: spaceM,
|
|
9
|
-
minHeight: 20,
|
|
10
|
-
width: "100%",
|
|
11
8
|
},
|
|
12
9
|
buttonText: {
|
|
13
10
|
textDecorationLine: "underline",
|
|
14
11
|
},
|
|
15
|
-
placeholder: {
|
|
16
|
-
width: 20,
|
|
17
|
-
},
|
|
18
12
|
});
|
|
19
13
|
export { style };
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
|
|
3
|
-
interface SpinnerProps {
|
|
4
|
-
readonly color?: ColorValue;
|
|
5
|
-
readonly size?: number | "large" | "small";
|
|
6
|
-
}
|
|
7
|
-
declare const Spinner: FC<SpinnerProps>;
|
|
2
|
+
declare const Spinner: FC;
|
|
8
3
|
export { Spinner };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Spinner as AuroraSpinner } from "@lookiero/aurora-next/build/components/atoms/Spinner/Spinner";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { theme } from "../../../../../infrastructure/ui/theme/theme";
|
|
3
|
+
import { View } from "react-native";
|
|
4
4
|
import { style } from "./Spinner.style";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
React.createElement(ActivityIndicator, { color: color, size: size })));
|
|
5
|
+
const Spinner = () => (React.createElement(View, { style: style.container },
|
|
6
|
+
React.createElement(AuroraSpinner, null)));
|
|
8
7
|
export { Spinner };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@lookiero/aurora-fonts": "^1.0.6",
|
|
47
47
|
"@lookiero/aurora-iconfont": "^2.0.37",
|
|
48
|
-
"@lookiero/aurora-next": "^3.0.
|
|
48
|
+
"@lookiero/aurora-next": "^3.0.191",
|
|
49
49
|
"@lookiero/data-sources": "^0.3",
|
|
50
50
|
"@lookiero/event": "^0.3",
|
|
51
51
|
"@lookiero/locale": "^0.3",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@expo/webpack-config": "^0.17.2",
|
|
68
68
|
"@lookiero/aurora-fonts": "^1.0.6",
|
|
69
69
|
"@lookiero/aurora-iconfont": "^2.0.37",
|
|
70
|
-
"@lookiero/aurora-next": "^3.0.
|
|
70
|
+
"@lookiero/aurora-next": "^3.0.191",
|
|
71
71
|
"@lookiero/data-sources": "^0.3",
|
|
72
72
|
"@lookiero/event": "^0.3",
|
|
73
73
|
"@lookiero/locale": "^0.3",
|