@lookiero/checkout 6.3.0 → 6.4.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/src/infrastructure/ui/views/checkout/Checkout.js +2 -1
- package/dist/src/infrastructure/ui/views/summary/Summary.js +3 -2
- 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 +1 -2
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +1 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +2 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
- package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +2 -2
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +2 -0
- package/src/infrastructure/ui/views/summary/Summary.tsx +3 -0
- package/src/infrastructure/ui/views/summary/components/pricing/Pricing.test.tsx +1 -0
- package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +2 -1
- package/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.tsx +3 -0
|
@@ -24,6 +24,7 @@ import { PaymentInstrument } from "./components/paymentInstrument/PaymentInstrum
|
|
|
24
24
|
const Checkout = ({ children, layout: LocalLayout, useRedirect }) => {
|
|
25
25
|
const { customer: { customerId, country, segment }, } = useStaticInfo();
|
|
26
26
|
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
|
|
27
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
27
28
|
const { screen } = useDevice();
|
|
28
29
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
29
30
|
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
|
|
@@ -79,7 +80,7 @@ const Checkout = ({ children, layout: LocalLayout, useRedirect }) => {
|
|
|
79
80
|
? checkoutItem.replacedFor.size
|
|
80
81
|
: checkoutItem.productVariant.size })))))),
|
|
81
82
|
React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L ? style.desktopResume : undefined] }, pricing ? (React.createElement(View, { style: style.princingWrapper },
|
|
82
|
-
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onSubmit: handleOnSubmit }))) : null)),
|
|
83
|
+
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, submitButtonText: submitButtonText, subtotal: pricing.subtotal, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onSubmit: handleOnSubmit }))) : null)),
|
|
83
84
|
children));
|
|
84
85
|
};
|
|
85
86
|
export { Checkout };
|
|
@@ -26,6 +26,7 @@ const Summary = ({ layout: LocalLayout, children }) => {
|
|
|
26
26
|
const [pricingHeight, setPricingHeight] = useState(0);
|
|
27
27
|
const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
|
|
28
28
|
const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
|
|
29
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
29
30
|
const { screen } = useDevice();
|
|
30
31
|
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
31
32
|
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
|
|
@@ -92,7 +93,7 @@ const Summary = ({ layout: LocalLayout, children }) => {
|
|
|
92
93
|
children)),
|
|
93
94
|
pricing && screen.L ? (React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L ? style.desktopResume : style.mobileResume] },
|
|
94
95
|
React.createElement(View, { style: style.princingWrapper },
|
|
95
|
-
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: false, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onSubmit: handleOnSubmit })))) : null)),
|
|
96
|
-
pricing && !screen.L ? (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: totalCheckoutItemsKept, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })) : null));
|
|
96
|
+
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: false, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, submitButtonText: submitButtonText, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onSubmit: handleOnSubmit })))) : null)),
|
|
97
|
+
pricing && !screen.L ? (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, submitButtonText: submitButtonText, totalCheckoutItemsKept: totalCheckoutItemsKept, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })) : null));
|
|
97
98
|
};
|
|
98
99
|
export { Summary };
|
|
@@ -9,14 +9,13 @@ import { style } from "./Pricing.style";
|
|
|
9
9
|
const Row = ({ action = false, text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
10
10
|
React.createElement(Text, { action: action, level: level }, text),
|
|
11
11
|
children));
|
|
12
|
-
const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPercentage = 0, totalCheckoutItemsKept, service, collapsible = true, collapsed = false, busy = false, onPress = () => void 0, onSubmit, }) => {
|
|
12
|
+
const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPercentage = 0, totalCheckoutItemsKept, service, collapsible = true, collapsed = false, busy = false, submitButtonText, onPress = () => void 0, onSubmit, }) => {
|
|
13
13
|
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL });
|
|
14
14
|
const totalCheckoutItemsKeptText = useI18nMessage({
|
|
15
15
|
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
16
16
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
17
17
|
});
|
|
18
18
|
const subtotalText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
19
|
-
const submitButtonText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
20
19
|
const freeText = useI18nMessage({ id: I18nMessages.SUMMARY_FREE });
|
|
21
20
|
const discountText = useI18nMessage({
|
|
22
21
|
id: I18nMessages.SUMMARY_DISCOUNT,
|
package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface StickyPricingProps {
|
|
|
5
5
|
readonly pricing: PricingProjection;
|
|
6
6
|
readonly totalCheckoutItemsKept: number;
|
|
7
7
|
readonly collapsed: boolean;
|
|
8
|
+
readonly submitButtonText: string;
|
|
8
9
|
readonly onPress: () => void;
|
|
9
10
|
readonly onSubmit: () => void;
|
|
10
11
|
readonly onLayout?: ({ width, height }: LayoutRectangle) => void;
|
|
@@ -3,7 +3,7 @@ import { Sticky } from "@lookiero/sty-psp-ui";
|
|
|
3
3
|
import { Body } from "../../../../components/layouts/body/Body";
|
|
4
4
|
import { Pricing } from "../pricing/Pricing";
|
|
5
5
|
import { style } from "./StickyPricing.style";
|
|
6
|
-
const StickyPricing = ({ pricing, totalCheckoutItemsKept, collapsed, onPress, onSubmit, onLayout, }) => (React.createElement(Sticky, { style: style.sticky, onLayout: onLayout },
|
|
6
|
+
const StickyPricing = ({ pricing, totalCheckoutItemsKept, collapsed, submitButtonText, onPress, onSubmit, onLayout, }) => (React.createElement(Sticky, { style: style.sticky, onLayout: onLayout },
|
|
7
7
|
React.createElement(Body, null,
|
|
8
|
-
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: collapsed, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onPress: onPress, onSubmit: onSubmit }))));
|
|
8
|
+
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: collapsed, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, submitButtonText: submitButtonText, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onPress: onPress, onSubmit: onSubmit }))));
|
|
9
9
|
export { StickyPricing };
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.4.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "6.
|
|
1
|
+
export const VERSION = "6.4.0";
|
package/package.json
CHANGED
|
@@ -111,8 +111,8 @@ describe("Checkout view", () => {
|
|
|
111
111
|
expect(getByText(I18nMessages.SUMMARY_FEE)).toBeTruthy();
|
|
112
112
|
expect(getByText("-€10.00")).toBeTruthy();
|
|
113
113
|
|
|
114
|
-
expect(getByText(I18nMessages.
|
|
115
|
-
fireEvent.press(getByText(I18nMessages.
|
|
114
|
+
expect(getByText(I18nMessages.CHECKOUT_PAY_BUTTON)).toBeTruthy();
|
|
115
|
+
fireEvent.press(getByText(I18nMessages.CHECKOUT_PAY_BUTTON));
|
|
116
116
|
expect(mockTrackPressContinue).toHaveBeenCalled();
|
|
117
117
|
expect(mockUseNavigate).toHaveBeenCalledWith(`/${Routes.CHECKOUT}/${Routes.CHECKOUT_PAYMENT}`, { replace: true });
|
|
118
118
|
|
|
@@ -34,6 +34,7 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: LocalLayout, useRedirec
|
|
|
34
34
|
customer: { customerId, country, segment },
|
|
35
35
|
} = useStaticInfo();
|
|
36
36
|
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
|
|
37
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
37
38
|
const { screen } = useDevice();
|
|
38
39
|
|
|
39
40
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
@@ -145,6 +146,7 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: LocalLayout, useRedirec
|
|
|
145
146
|
discountPercentage={pricing.discountPercentage}
|
|
146
147
|
pendingToPay={pricing.pendingToPay}
|
|
147
148
|
service={pricing.service}
|
|
149
|
+
submitButtonText={submitButtonText}
|
|
148
150
|
subtotal={pricing.subtotal}
|
|
149
151
|
totalCheckoutItemsKept={checkoutItemsKept?.length || 0}
|
|
150
152
|
onSubmit={handleOnSubmit}
|
|
@@ -35,6 +35,7 @@ const Summary: FC<SummaryProps> = ({ layout: LocalLayout, children }) => {
|
|
|
35
35
|
const [pricingHeight, setPricingHeight] = useState(0);
|
|
36
36
|
const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
|
|
37
37
|
const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
|
|
38
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
38
39
|
const { screen } = useDevice();
|
|
39
40
|
|
|
40
41
|
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
@@ -148,6 +149,7 @@ const Summary: FC<SummaryProps> = ({ layout: LocalLayout, children }) => {
|
|
|
148
149
|
discountPercentage={pricing.discountPercentage}
|
|
149
150
|
pendingToPay={pricing.pendingToPay}
|
|
150
151
|
service={pricing.service}
|
|
152
|
+
submitButtonText={submitButtonText}
|
|
151
153
|
subtotal={pricing.subtotal}
|
|
152
154
|
totalCheckoutItemsKept={totalCheckoutItemsKept}
|
|
153
155
|
onSubmit={handleOnSubmit}
|
|
@@ -161,6 +163,7 @@ const Summary: FC<SummaryProps> = ({ layout: LocalLayout, children }) => {
|
|
|
161
163
|
<StickyPricing
|
|
162
164
|
collapsed={pricingCollapsed}
|
|
163
165
|
pricing={pricing}
|
|
166
|
+
submitButtonText={submitButtonText}
|
|
164
167
|
totalCheckoutItemsKept={totalCheckoutItemsKept}
|
|
165
168
|
onLayout={Platform.OS !== "web" ? handleOnPricingLayout : undefined}
|
|
166
169
|
onPress={handleOnPressPricing}
|
|
@@ -33,6 +33,7 @@ const renderPricing: RenderPricingFunction = ({
|
|
|
33
33
|
discountPercentage={pricing.discountPercentage}
|
|
34
34
|
pendingToPay={pricing.pendingToPay}
|
|
35
35
|
service={pricing.service}
|
|
36
|
+
submitButtonText={I18nMessages.SUMMARY_SUBMIT_BUTTON}
|
|
36
37
|
subtotal={pricing.subtotal}
|
|
37
38
|
totalCheckoutItemsKept={3}
|
|
38
39
|
onPress={mockOnPress}
|
|
@@ -35,6 +35,7 @@ interface PricingProps {
|
|
|
35
35
|
readonly collapsible?: boolean;
|
|
36
36
|
readonly collapsed?: boolean;
|
|
37
37
|
readonly busy?: boolean;
|
|
38
|
+
readonly submitButtonText: string;
|
|
38
39
|
readonly onPress?: () => void;
|
|
39
40
|
readonly onSubmit: () => void;
|
|
40
41
|
}
|
|
@@ -49,6 +50,7 @@ const Pricing: FC<PricingProps> = ({
|
|
|
49
50
|
collapsible = true,
|
|
50
51
|
collapsed = false,
|
|
51
52
|
busy = false,
|
|
53
|
+
submitButtonText,
|
|
52
54
|
onPress = () => void 0,
|
|
53
55
|
onSubmit,
|
|
54
56
|
}) => {
|
|
@@ -58,7 +60,6 @@ const Pricing: FC<PricingProps> = ({
|
|
|
58
60
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
59
61
|
});
|
|
60
62
|
const subtotalText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
61
|
-
const submitButtonText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
62
63
|
const freeText = useI18nMessage({ id: I18nMessages.SUMMARY_FREE });
|
|
63
64
|
const discountText = useI18nMessage({
|
|
64
65
|
id: I18nMessages.SUMMARY_DISCOUNT,
|
|
@@ -10,6 +10,7 @@ interface StickyPricingProps {
|
|
|
10
10
|
readonly pricing: PricingProjection;
|
|
11
11
|
readonly totalCheckoutItemsKept: number;
|
|
12
12
|
readonly collapsed: boolean;
|
|
13
|
+
readonly submitButtonText: string;
|
|
13
14
|
readonly onPress: () => void;
|
|
14
15
|
readonly onSubmit: () => void;
|
|
15
16
|
readonly onLayout?: ({ width, height }: LayoutRectangle) => void;
|
|
@@ -18,6 +19,7 @@ const StickyPricing: FC<StickyPricingProps> = ({
|
|
|
18
19
|
pricing,
|
|
19
20
|
totalCheckoutItemsKept,
|
|
20
21
|
collapsed,
|
|
22
|
+
submitButtonText,
|
|
21
23
|
onPress,
|
|
22
24
|
onSubmit,
|
|
23
25
|
onLayout,
|
|
@@ -31,6 +33,7 @@ const StickyPricing: FC<StickyPricingProps> = ({
|
|
|
31
33
|
discountPercentage={pricing.discountPercentage}
|
|
32
34
|
pendingToPay={pricing.pendingToPay}
|
|
33
35
|
service={pricing.service}
|
|
36
|
+
submitButtonText={submitButtonText}
|
|
34
37
|
subtotal={pricing.subtotal}
|
|
35
38
|
totalCheckoutItemsKept={totalCheckoutItemsKept}
|
|
36
39
|
onPress={onPress}
|