@lookiero/checkout 0.3.9 → 0.3.11
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/package.json +2 -2
- package/dist/src/ExpoRoot.js +1 -1
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.d.ts +0 -1
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +3 -1
- package/dist/src/infrastructure/ui/routing/Routing.js +7 -5
- package/dist/src/infrastructure/ui/routing/useBasePath.d.ts +8 -0
- package/dist/src/infrastructure/ui/routing/useBasePath.js +9 -0
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +19 -14
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +5 -10
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +6 -11
- package/dist/src/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +1 -1
- package/dist/src/infrastructure/ui/views/summary/Summary.js +5 -3
- package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.d.ts +1 -0
- package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +4 -4
- package/package.json +2 -2
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"eslint-plugin-react": "^7.31.8",
|
|
90
90
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
91
91
|
"eslint-plugin-react-native": "^4.0.0",
|
|
92
|
-
"expo": "~
|
|
92
|
+
"expo": "~46.0.8",
|
|
93
93
|
"expo-status-bar": "~1.4.0",
|
|
94
94
|
"graphql": "14.5.8",
|
|
95
95
|
"graphql-tag": "2.12.6",
|
package/dist/src/ExpoRoot.js
CHANGED
|
@@ -15,7 +15,7 @@ import { root } from "./infrastructure/ui/Root";
|
|
|
15
15
|
import { Router } from "./infrastructure/ui/routing/router/Router";
|
|
16
16
|
import { notificationsRoot } from "./shared/notifications";
|
|
17
17
|
const apiUrl = Platform.OS !== "web" ? "https://web2.ps.dev.aws.lookiero.es/checkout/api" : __DEV__ ? "/local-to-dev" : "/api";
|
|
18
|
-
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
18
|
+
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIwOTUxNjAsImV4cCI6MTY3MjI5OTg4MSwiZGlzcGxheU5hbWUiOiJBbGV4YW5kZXIiLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0wOS0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiJjZjdjNjQxZi0wZTVjLTQ4NTAtYWUwNy0yNzY3NDdlZGZkMGIiLCJpYXQiOjE2Njk3MDc4ODF9.-nGGMNmMlsq-PsupefyjxH0Z3td7ybM9TpnUV_VIYSg";
|
|
19
19
|
const translationsUrl = Platform.OS !== "web" ? "https://web2.ps.dev.aws.lookiero.es/checkout/i18n" : __DEV__ ? "/local-to-i18n" : "/i18n";
|
|
20
20
|
const translationsApiKey = "f2AfMGaPCZGVbAFWz_OV4GWhBDG_NbZJ";
|
|
21
21
|
const translations = (locale) => `${translationsUrl}/${locale}?key=${translationsApiKey}&no-folding=true`;
|
|
@@ -6,7 +6,9 @@ import { Spinner } from "../../../shared/ui/components/atoms/spinner/Spinner";
|
|
|
6
6
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
7
7
|
import { useShouldIntroBeShown } from "../../projection/uiSetting/react/useShouldIntroBeShown";
|
|
8
8
|
import { Routes } from "./routes";
|
|
9
|
-
|
|
9
|
+
import { useBasePath } from "./useBasePath";
|
|
10
|
+
const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner, null), children }) => {
|
|
11
|
+
const basePath = useBasePath();
|
|
10
12
|
const introShown = useRef(false);
|
|
11
13
|
const [shouldIntroBeShown, shouldIntroBeShownStatus] = useShouldIntroBeShown();
|
|
12
14
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
@@ -5,6 +5,7 @@ import { App } from "../views/App";
|
|
|
5
5
|
import { CheckoutAccessibilityMiddleware } from "./CheckoutAccessibilityMiddleware";
|
|
6
6
|
import { CheckoutMiddleware } from "./CheckoutMiddleware";
|
|
7
7
|
import { Routes } from "./routes";
|
|
8
|
+
import { BasePathProvider } from "./useBasePath";
|
|
8
9
|
const Intro = lazy(() => import("../views/intro/Intro").then((module) => ({ default: module.Intro })));
|
|
9
10
|
const Item = lazy(() => import("../views/item/Item").then((module) => ({ default: module.Item })));
|
|
10
11
|
const Summary = lazy(() => import("../views/summary/Summary").then((module) => ({ default: module.Summary })));
|
|
@@ -13,11 +14,12 @@ const Routing = ({ basePath = "", customerId, locale, I18n, authToken, onI18nErr
|
|
|
13
14
|
const routes = useRoutes([
|
|
14
15
|
{
|
|
15
16
|
path: "",
|
|
16
|
-
element: (React.createElement(
|
|
17
|
-
React.createElement(
|
|
18
|
-
React.createElement(
|
|
19
|
-
React.createElement(
|
|
20
|
-
React.createElement(
|
|
17
|
+
element: (React.createElement(BasePathProvider, { basePath: basePath },
|
|
18
|
+
React.createElement(CheckoutAccessibilityMiddleware, { customerId: customerId, onNotAccessible: onNotAccessible },
|
|
19
|
+
React.createElement(I18n, { loader: React.createElement(Spinner, null), locale: locale, onError: onI18nError },
|
|
20
|
+
React.createElement(CheckoutMiddleware, { customerId: customerId },
|
|
21
|
+
React.createElement(App, null,
|
|
22
|
+
React.createElement(Outlet, null))))))),
|
|
21
23
|
children: [
|
|
22
24
|
{
|
|
23
25
|
path: Routes.INTRO,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { invariant } from "@remix-run/router";
|
|
2
|
+
import React, { createContext, useContext } from "react";
|
|
3
|
+
const BasePathContext = createContext(null);
|
|
4
|
+
export const BasePathProvider = ({ basePath, children }) => (React.createElement(BasePathContext.Provider, { value: basePath }, children));
|
|
5
|
+
export const useBasePath = () => {
|
|
6
|
+
const basePath = useContext(BasePathContext);
|
|
7
|
+
invariant(basePath, "Your are trying to use the useBasePath hook without wrapping your app with the <BasePathProvider>.");
|
|
8
|
+
return basePath;
|
|
9
|
+
};
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
3
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
3
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
5
4
|
import { CheckoutStatus, PaymentFlow } from "@lookiero/payments-front";
|
|
6
|
-
import React, { useCallback, useRef, useState } from "react";
|
|
5
|
+
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
7
6
|
import { View } from "react-native";
|
|
8
7
|
import { useNavigate } from "react-router-native";
|
|
8
|
+
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
9
9
|
import { useCreateNotification } from "../../../../shared/notifications";
|
|
10
10
|
import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
|
|
11
11
|
import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
|
|
12
12
|
import { useMarkCheckoutAsPaid } from "../../../domain/checkout/react/useMarkCheckoutAsPaid";
|
|
13
13
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
14
14
|
import { useViewPaymentFlowPayloadByCheckoutId } from "../../../projection/payment/react/useViewPaymentFlowPayloadByCheckoutId";
|
|
15
|
+
import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
|
|
15
16
|
import { Body } from "../../components/layouts/body/Body";
|
|
16
17
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
17
18
|
import { I18nMessages } from "../../i18n/i18n";
|
|
18
19
|
import { Routes } from "../../routing/routes";
|
|
20
|
+
import { useBasePath } from "../../routing/useBasePath";
|
|
21
|
+
import { ProductVariant } from "../item/components/productVariant/ProductVariant";
|
|
22
|
+
import { Pricing } from "../summary/components/pricing/Pricing";
|
|
19
23
|
import { style } from "./Checkout.style";
|
|
20
24
|
import { CheckoutSuccessModal } from "./components/CheckoutSuccessModal";
|
|
21
25
|
const Checkout = ({ customerId, authToken }) => {
|
|
22
26
|
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
|
|
23
|
-
const payButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
24
27
|
const paymentFlowRef = useRef(null);
|
|
25
28
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
29
|
+
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
|
|
26
30
|
const [paymentFlowPayload] = useViewPaymentFlowPayloadByCheckoutId({
|
|
27
31
|
checkoutId: checkout?.id,
|
|
28
32
|
});
|
|
@@ -30,7 +34,9 @@ const Checkout = ({ customerId, authToken }) => {
|
|
|
30
34
|
const [createNotification] = useCreateNotification();
|
|
31
35
|
const [processingCheckout, setProcessingCheckout] = useState(false);
|
|
32
36
|
const navigate = useNavigate();
|
|
33
|
-
const
|
|
37
|
+
const basePath = useBasePath();
|
|
38
|
+
const handleOnSubmitCheckout = useCallback(() => {
|
|
39
|
+
console.log("onSubmit checkout");
|
|
34
40
|
if (!paymentFlowRef.current) {
|
|
35
41
|
return;
|
|
36
42
|
}
|
|
@@ -57,22 +63,21 @@ const Checkout = ({ customerId, authToken }) => {
|
|
|
57
63
|
}
|
|
58
64
|
});
|
|
59
65
|
}, [createNotification, markAsPaid, paymentFlowPayload]);
|
|
60
|
-
const handleOnSuccessModalDismiss = useCallback(() => navigate(Routes.FEEDBACK), [navigate]);
|
|
66
|
+
const handleOnSuccessModalDismiss = useCallback(() => navigate(`${basePath}/${Routes.FEEDBACK}`), [basePath, navigate]);
|
|
67
|
+
const checkoutItemsKept = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
|
|
61
68
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
62
|
-
const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutStatus);
|
|
69
|
+
const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutStatus) && dependenciesLoadedStatuses.includes(pricingStatus);
|
|
63
70
|
if (!dependenciesLoaded)
|
|
64
71
|
return React.createElement(Spinner, null);
|
|
65
72
|
return (React.createElement(React.Fragment, null,
|
|
73
|
+
React.createElement(CheckoutSuccessModal, { visible: markAsPaidStatus === CommandStatus.SUCCESS, onDismiss: handleOnSuccessModalDismiss }),
|
|
66
74
|
React.createElement(SafeAreaScrollView, null,
|
|
67
75
|
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
68
|
-
React.createElement(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
testID: "submit-checkout-button", onPress: onSubmitCheckout }, payButtonText),
|
|
75
|
-
React.createElement(CheckoutSuccessModal, { visible: markAsPaidStatus === CommandStatus.SUCCESS, onDismiss: handleOnSuccessModalDismiss }))))),
|
|
76
|
+
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
77
|
+
checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, style: style.checkoutItemKept, testID: "checkout-items-kept" },
|
|
78
|
+
React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, size: checkoutItem.productVariant.size, status: checkoutItem.status })))),
|
|
79
|
+
pricing && (React.createElement(View, { style: style.pricingContainer },
|
|
80
|
+
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, busy: processingCheckout || markAsPaidStatus === CommandStatus.LOADING, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, orderTotal: pricing.orderTotal, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onSubmit: handleOnSubmitCheckout }))))),
|
|
76
81
|
React.createElement(PaymentFlow, { ref: paymentFlowRef, token: authToken })));
|
|
77
82
|
};
|
|
78
83
|
export { Checkout };
|
|
@@ -2,20 +2,15 @@ declare const style: {
|
|
|
2
2
|
bodyColumn: {
|
|
3
3
|
paddingHorizontal: number;
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
flexDirection: "row";
|
|
8
|
-
marginVertical: number;
|
|
5
|
+
checkoutItemKept: {
|
|
6
|
+
paddingVertical: number;
|
|
9
7
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
justifyContent: "space-between";
|
|
13
|
-
};
|
|
14
|
-
content: {
|
|
15
|
-
alignItems: "center";
|
|
8
|
+
pricingContainer: {
|
|
9
|
+
marginTop: number;
|
|
16
10
|
};
|
|
17
11
|
title: {
|
|
18
12
|
marginBottom: number;
|
|
13
|
+
marginTop: number;
|
|
19
14
|
textAlign: "center";
|
|
20
15
|
};
|
|
21
16
|
};
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../theme/theme";
|
|
3
|
-
const {
|
|
3
|
+
const { spaceM, spaceXL, spaceXXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
bodyColumn: {
|
|
6
6
|
paddingHorizontal: spaceXL,
|
|
7
7
|
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
flexDirection: "row",
|
|
11
|
-
marginVertical: spaceS,
|
|
8
|
+
checkoutItemKept: {
|
|
9
|
+
paddingVertical: spaceM,
|
|
12
10
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
justifyContent: "space-between",
|
|
16
|
-
},
|
|
17
|
-
content: {
|
|
18
|
-
alignItems: "center",
|
|
11
|
+
pricingContainer: {
|
|
12
|
+
marginTop: spaceXL,
|
|
19
13
|
},
|
|
20
14
|
title: {
|
|
21
15
|
marginBottom: spaceM,
|
|
16
|
+
marginTop: spaceXXL,
|
|
22
17
|
textAlign: "center",
|
|
23
18
|
},
|
|
24
19
|
});
|
|
@@ -14,7 +14,7 @@ const ProductVariant = ({ media, brand, name, price, size, color, status, discar
|
|
|
14
14
|
const colorLabel = useI18nMessage({ id: color.label, prefix: COLOR_I18N_PREFIX });
|
|
15
15
|
const sizeChangeText = useI18nMessage({ id: I18nMessages.PRODUCT_VARIANT_SIZE_CHANGE });
|
|
16
16
|
const cdnImageUrl = useMediaImage();
|
|
17
|
-
return (React.createElement(Pressable, { style: style.container, testID: "product-variant", onPress: onPress },
|
|
17
|
+
return (React.createElement(Pressable, { pointerEvents: onPress ? "auto" : "none", style: style.container, testID: "product-variant", onPress: onPress },
|
|
18
18
|
React.createElement(View, { style: style.row },
|
|
19
19
|
React.createElement(View, null,
|
|
20
20
|
React.createElement(Image, { resizeMode: "contain", style: [style.media, customStyle?.image], testID: "product-variant-media", source: {
|
|
@@ -13,6 +13,7 @@ import { Body } from "../../components/layouts/body/Body";
|
|
|
13
13
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
14
14
|
import { I18nMessages } from "../../i18n/i18n";
|
|
15
15
|
import { Routes } from "../../routing/routes";
|
|
16
|
+
import { useBasePath } from "../../routing/useBasePath";
|
|
16
17
|
import { style } from "./Summary.style";
|
|
17
18
|
import { CheckoutItemsTabs } from "./components/checkoutItemsTabs/CheckoutItemsTabs";
|
|
18
19
|
import { FiveItemsDiscountBanner } from "./components/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
|
|
@@ -23,11 +24,12 @@ const Summary = ({ customerId }) => {
|
|
|
23
24
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
24
25
|
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
|
|
25
26
|
const [fiveItemsDiscount = 0, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({ customerId });
|
|
27
|
+
const navigate = useNavigate();
|
|
28
|
+
const basePath = useBasePath();
|
|
26
29
|
const [pricingCollapsed, setPricingCollapsed] = useState(true);
|
|
27
30
|
const handleOnPressPricing = useCallback(() => setPricingCollapsed(!pricingCollapsed), [pricingCollapsed]);
|
|
28
|
-
const handleOnSubmit = useCallback(() =>
|
|
29
|
-
const
|
|
30
|
-
const handleOnPressItem = useCallback((checkoutItemId) => navigate(generatePath(Routes.ITEM_DETAIL, { id: checkoutItemId })), [navigate]);
|
|
31
|
+
const handleOnSubmit = useCallback(() => navigate(`${basePath}/${Routes.CHECKOUT}`), [basePath, navigate]);
|
|
32
|
+
const handleOnPressItem = useCallback((checkoutItemId) => navigate(`${basePath}/${generatePath(Routes.ITEM_DETAIL, { id: checkoutItemId })}`), [basePath, navigate]);
|
|
31
33
|
const checkoutItemsKept = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
|
|
32
34
|
const checkoutItemsReturned = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.RETURNED || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
|
|
33
35
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
@@ -13,7 +13,7 @@ const PS_SERVICE_FREE_INDICATOR = 100;
|
|
|
13
13
|
const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
14
14
|
React.createElement(Text, { level: level, style: style.uppercase, action: true }, text),
|
|
15
15
|
children));
|
|
16
|
-
const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPercentage = 0, totalCheckoutItemsKept, service, collapsible = true, collapsed = false, onPress = () => void 0, onSubmit, }) => {
|
|
16
|
+
const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPercentage = 0, totalCheckoutItemsKept, service, collapsible = true, collapsed = false, busy = false, onPress = () => void 0, onSubmit, }) => {
|
|
17
17
|
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL }) || "";
|
|
18
18
|
const totalCheckoutItemsKeptText = useI18nMessage({
|
|
19
19
|
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
@@ -31,7 +31,7 @@ const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPerc
|
|
|
31
31
|
const isPSServiceFree = service.discount.amount === PS_SERVICE_FREE_INDICATOR;
|
|
32
32
|
const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
|
|
33
33
|
const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
|
|
34
|
-
return (React.createElement(Pressable, {
|
|
34
|
+
return (React.createElement(Pressable, { testID: "pricing", onPress: collapsible ? onPress : null },
|
|
35
35
|
collapsible && (React.createElement(View, { style: style.iconContainer }, collapsed ? (React.createElement(ArrowUp, { style: style.icon, testID: "arrow-up" })) : (React.createElement(ArrowDown, { style: style.icon, testID: "arrow-down" })))),
|
|
36
36
|
collapsed && collapsible ? (React.createElement(animated.View, { style: [style.collapsed, { opacity: collapsedStyle.opacitiy }] },
|
|
37
37
|
React.createElement(View, null,
|
|
@@ -41,7 +41,7 @@ const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPerc
|
|
|
41
41
|
totalCheckoutItemsKeptText),
|
|
42
42
|
React.createElement(Price, { price: orderTotal, variant: "detail" })),
|
|
43
43
|
React.createElement(View, null,
|
|
44
|
-
React.createElement(Button, { small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
|
|
44
|
+
React.createElement(Button, { busy: busy, small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
|
|
45
45
|
React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
|
|
46
46
|
React.createElement(Price, { price: subtotal, variant: "subtotal" })),
|
|
47
47
|
discount && (React.createElement(Row, { text: discountText },
|
|
@@ -52,6 +52,6 @@ const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPerc
|
|
|
52
52
|
React.createElement(View, { style: style.divider }),
|
|
53
53
|
React.createElement(Row, { level: 2, text: totalText },
|
|
54
54
|
React.createElement(Price, { price: orderTotal, variant: "total" })),
|
|
55
|
-
React.createElement(Button, { onPress: onSubmit }, submitButtonText)))));
|
|
55
|
+
React.createElement(Button, { busy: busy, onPress: onSubmit }, submitButtonText)))));
|
|
56
56
|
};
|
|
57
57
|
export { Pricing };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"eslint-plugin-react": "^7.31.8",
|
|
90
90
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
91
91
|
"eslint-plugin-react-native": "^4.0.0",
|
|
92
|
-
"expo": "~
|
|
92
|
+
"expo": "~46.0.8",
|
|
93
93
|
"expo-status-bar": "~1.4.0",
|
|
94
94
|
"graphql": "14.5.8",
|
|
95
95
|
"graphql-tag": "2.12.6",
|