@lookiero/checkout 6.5.0-beta.3 → 6.5.0-beta.5
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 +26 -17
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +11 -0
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +14 -2
- package/dist/src/infrastructure/ui/views/item/Item.js +1 -1
- package/dist/src/infrastructure/ui/views/item/Item.style.d.ts +3 -0
- package/dist/src/infrastructure/ui/views/item/Item.style.js +3 -0
- package/dist/src/infrastructure/ui/views/summary/Summary.js +1 -0
- package/dist/src/infrastructure/ui/views/summary/Summary.style.d.ts +3 -0
- package/dist/src/infrastructure/ui/views/summary/Summary.style.js +6 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +3 -3
- package/src/infrastructure/ui/components/templates/header/__snapshots__/Header.test.tsx.snap +1 -0
- package/src/infrastructure/ui/components/templates/header/checkoutHeader/__snapshots__/CheckoutHeader.test.tsx.snap +132 -141
- package/src/infrastructure/ui/components/templates/header/itemDetailHeader/__snapshots__/ItemDetailHeader.test.tsx.snap +4 -1
- package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +3 -2
- package/src/infrastructure/ui/views/checkout/Checkout.style.ts +14 -2
- package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +1 -1
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +69 -45
- package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/Item.style.ts +3 -0
- package/src/infrastructure/ui/views/item/Item.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/Item.tsx +1 -1
- package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +2 -2
- package/src/infrastructure/ui/views/summary/Summary.style.ts +5 -2
- package/src/infrastructure/ui/views/summary/Summary.test.tsx +1 -1
- package/src/infrastructure/ui/views/summary/Summary.tsx +1 -0
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.test.tsx +2 -2
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +19 -13
- /package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/{Pricing.test.tsx.snap → CollapsiblePricing.test.tsx.snap} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { useCallback, useMemo } from "react";
|
|
2
|
-
import { View } from "react-native";
|
|
1
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { Platform, ScrollView, View } from "react-native";
|
|
3
3
|
import { useNavigate } from "react-router-native";
|
|
4
4
|
import { Box, Button, Layout, Spinner, Text, useDevice } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
7
|
+
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
7
8
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
8
9
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
9
10
|
import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
|
|
@@ -11,6 +12,7 @@ import { TrackingPage } from "../../../tracking/tracking";
|
|
|
11
12
|
import { useTrackPageView } from "../../../tracking/useTrackPageView";
|
|
12
13
|
import { useTrackPressBack } from "../../../tracking/useTrackPressBack";
|
|
13
14
|
import { useTrackPressContinue } from "../../../tracking/useTrackPressContinue";
|
|
15
|
+
import { Body } from "../../components/layouts/body/Body";
|
|
14
16
|
import { CheckoutHeader } from "../../components/templates/header/checkoutHeader/CheckoutHeader";
|
|
15
17
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
16
18
|
import { I18nMessages } from "../../i18n/i18n";
|
|
@@ -26,6 +28,8 @@ const Checkout = ({ children, layout: LocalLayout, useRedirect }) => {
|
|
|
26
28
|
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
|
|
27
29
|
const submitButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
28
30
|
const { screen } = useDevice();
|
|
31
|
+
const [pricingHeight, setPricingHeight] = useState(0);
|
|
32
|
+
const handleOnPricingLayout = useCallback(({ height }) => setPricingHeight(height), []);
|
|
29
33
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
30
34
|
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
|
|
31
35
|
useTrackPageView({
|
|
@@ -64,23 +68,28 @@ const Checkout = ({ children, layout: LocalLayout, useRedirect }) => {
|
|
|
64
68
|
if (!dependenciesLoaded) {
|
|
65
69
|
return React.createElement(Spinner, null);
|
|
66
70
|
}
|
|
67
|
-
return (React.createElement(LocalLayout, { header: React.createElement(CheckoutHeader, { onBack: handleOnBack }), style: {
|
|
71
|
+
return (React.createElement(LocalLayout, { header: React.createElement(CheckoutHeader, { onBack: handleOnBack }), scrollEnabled: false, style: {
|
|
72
|
+
header: style.header,
|
|
68
73
|
scrollView: style.scrollView,
|
|
69
74
|
} },
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
React.createElement(
|
|
73
|
-
React.createElement(
|
|
74
|
-
React.createElement(
|
|
75
|
-
|
|
76
|
-
React.createElement(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
React.createElement(
|
|
81
|
-
|
|
82
|
-
React.createElement(
|
|
83
|
-
|
|
75
|
+
React.createElement(ScrollView, { showsVerticalScrollIndicator: false },
|
|
76
|
+
hasReplacedCheckoutItem && React.createElement(DeliveryBanner, null),
|
|
77
|
+
React.createElement(Layout, { fullWidth: !screen.L, style: [screen.L && style.desktopLayoutSpacing, !screen.L && { paddingBottom: pricingHeight }] },
|
|
78
|
+
React.createElement(Box, { size: { L: "2/3" }, style: screen.L && style.desktopListSpacing },
|
|
79
|
+
React.createElement(View, { style: [style.contentWrapper, screen.L && style.desktopContentWrapper] },
|
|
80
|
+
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
81
|
+
checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, testID: "checkout-items-kept" },
|
|
82
|
+
React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, country: country, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, status: checkoutItem.status, size: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
|
|
83
|
+
? checkoutItem.replacedFor.size
|
|
84
|
+
: checkoutItem.productVariant.size })))),
|
|
85
|
+
React.createElement(View, { style: style.paymentSelector },
|
|
86
|
+
React.createElement(PaymentInstrument, { useRedirect: useRedirect })))),
|
|
87
|
+
React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L && style.desktopResume] }, pricing ? (React.createElement(View, { style: [style.princingWrapper, !screen.L && style.princingWrapperSmall] },
|
|
88
|
+
React.createElement(Pricing, { pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0 }),
|
|
89
|
+
screen.L ? (React.createElement(Button, { testID: "confirm-checkout-button", onPress: handleOnSubmit }, submitButtonText)) : null)) : null))),
|
|
90
|
+
pricing && !screen.L ? (React.createElement(Sticky, { style: style.sticky, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined },
|
|
91
|
+
React.createElement(Body, null,
|
|
92
|
+
React.createElement(Button, { testID: "confirm-checkout-button", small: true, onPress: handleOnSubmit }, submitButtonText)))) : null,
|
|
84
93
|
children));
|
|
85
94
|
};
|
|
86
95
|
export { Checkout };
|
|
@@ -18,15 +18,26 @@ declare const style: {
|
|
|
18
18
|
desktopResume: {
|
|
19
19
|
borderRadius: number;
|
|
20
20
|
};
|
|
21
|
+
header: {
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
21
24
|
paymentSelector: {
|
|
22
25
|
marginTop: number;
|
|
23
26
|
};
|
|
24
27
|
princingWrapper: {
|
|
25
28
|
padding: number;
|
|
26
29
|
};
|
|
30
|
+
princingWrapperSmall: {
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
};
|
|
27
33
|
resume: any;
|
|
28
34
|
scrollView: {
|
|
29
35
|
backgroundColor: string;
|
|
36
|
+
flex: number;
|
|
37
|
+
};
|
|
38
|
+
sticky: {
|
|
39
|
+
paddingBottom: number;
|
|
40
|
+
paddingTop: number;
|
|
30
41
|
};
|
|
31
42
|
title: {
|
|
32
43
|
marginBottom: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StyleSheet, Platform } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
|
|
3
|
+
import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
|
|
4
|
+
const { borderRadius4, colorBgPrimaryLight, colorBgBase, space3, space4, space6, space12, space16 } = theme();
|
|
4
5
|
const style = StyleSheet.create({
|
|
5
6
|
contentWrapper: {
|
|
6
7
|
backgroundColor: colorBgBase,
|
|
@@ -21,19 +22,25 @@ const style = StyleSheet.create({
|
|
|
21
22
|
desktopResume: {
|
|
22
23
|
borderRadius: borderRadius4,
|
|
23
24
|
},
|
|
25
|
+
header: {
|
|
26
|
+
height: HEADER_HEIGHT,
|
|
27
|
+
},
|
|
24
28
|
paymentSelector: {
|
|
25
29
|
marginTop: space6,
|
|
26
30
|
},
|
|
27
31
|
princingWrapper: {
|
|
28
32
|
padding: space6,
|
|
29
33
|
},
|
|
34
|
+
princingWrapperSmall: {
|
|
35
|
+
backgroundColor: colorBgPrimaryLight,
|
|
36
|
+
},
|
|
30
37
|
resume: {
|
|
31
38
|
overflow: "hidden",
|
|
32
39
|
backgroundColor: colorBgBase,
|
|
33
40
|
...Platform.select({
|
|
34
41
|
web: {
|
|
35
42
|
position: "sticky",
|
|
36
|
-
top:
|
|
43
|
+
top: space12,
|
|
37
44
|
alignSelf: "flex-start",
|
|
38
45
|
},
|
|
39
46
|
}),
|
|
@@ -41,6 +48,11 @@ const style = StyleSheet.create({
|
|
|
41
48
|
},
|
|
42
49
|
scrollView: {
|
|
43
50
|
backgroundColor: colorBgPrimaryLight,
|
|
51
|
+
flex: 1,
|
|
52
|
+
},
|
|
53
|
+
sticky: {
|
|
54
|
+
paddingBottom: space4,
|
|
55
|
+
paddingTop: space3,
|
|
44
56
|
},
|
|
45
57
|
title: {
|
|
46
58
|
marginBottom: space4,
|
|
@@ -170,7 +170,7 @@ const Item = ({ layout: Layout }) => {
|
|
|
170
170
|
}
|
|
171
171
|
return (React.createElement(ReturnQuestionFeedbackProvider, { key: checkoutItem.id, feedback: checkoutItem.feedbacks || {} },
|
|
172
172
|
React.createElement(Layout, { header: header, scrollEnabled: !itemWithoutCustomerDecission, style: {
|
|
173
|
-
header: fiveItemsDiscount !== 0
|
|
173
|
+
header: fiveItemsDiscount !== 0 ? style.headerWithDoubleHeight : style.header,
|
|
174
174
|
scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
|
|
175
175
|
safeAreaView: isDesktopScreen ? style.safeAreaView : null,
|
|
176
176
|
} }, itemWithoutCustomerDecission ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, onReturn: redirectToReturnPage ? goToReturnPage : showReturnQuestions })) : (React.createElement(ItemWithCustomerDecission, { checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, returnQuestions: returnQuestions, onEditFeedback: redirectToReturnPage ? goToReturnPage : showReturnQuestions }))),
|
|
@@ -80,6 +80,7 @@ const Summary = ({ layout: LocalLayout, children }) => {
|
|
|
80
80
|
return React.createElement(Spinner, null);
|
|
81
81
|
}
|
|
82
82
|
return (React.createElement(LocalLayout, { scrollEnabled: false, style: {
|
|
83
|
+
header: style.header,
|
|
83
84
|
scrollView: style.scrollView,
|
|
84
85
|
} },
|
|
85
86
|
React.createElement(ScrollView, { showsVerticalScrollIndicator: false },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Platform, StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
|
|
3
|
+
import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
|
|
4
|
+
const { colorTextMedium, colorText, colorBgPrimaryLight, space2, space3, space4, space6, space12, space16, borderRadius4, colorBgBase, } = theme();
|
|
4
5
|
const style = StyleSheet.create({
|
|
5
6
|
contentWrapper: {
|
|
6
7
|
backgroundColor: colorBgBase,
|
|
@@ -24,6 +25,9 @@ const style = StyleSheet.create({
|
|
|
24
25
|
desktopResume: {
|
|
25
26
|
borderRadius: borderRadius4,
|
|
26
27
|
},
|
|
28
|
+
header: {
|
|
29
|
+
height: HEADER_HEIGHT,
|
|
30
|
+
},
|
|
27
31
|
mobileInfo: {
|
|
28
32
|
paddingHorizontal: space6,
|
|
29
33
|
paddingTop: space6,
|
|
@@ -49,7 +53,7 @@ const style = StyleSheet.create({
|
|
|
49
53
|
...Platform.select({
|
|
50
54
|
web: {
|
|
51
55
|
position: "sticky",
|
|
52
|
-
top:
|
|
56
|
+
top: space12,
|
|
53
57
|
alignSelf: "flex-start",
|
|
54
58
|
},
|
|
55
59
|
}),
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "6.5.0-beta.
|
|
1
|
+
export declare const VERSION = "6.5.0-beta.5";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "6.5.0-beta.
|
|
1
|
+
export const VERSION = "6.5.0-beta.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "6.5.0-beta.
|
|
3
|
+
"version": "6.5.0-beta.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@lookiero/sty-psp-i18n": "^0.1.7",
|
|
22
22
|
"@lookiero/sty-psp-locale": "^0.2.1",
|
|
23
23
|
"@lookiero/sty-psp-logging": "^0.2.2",
|
|
24
|
-
"@lookiero/sty-psp-notifications": "^0.5.8",
|
|
24
|
+
"@lookiero/sty-psp-notifications": "^0.5.8-beta.0",
|
|
25
25
|
"@lookiero/sty-psp-react-native": "^0.2.0",
|
|
26
26
|
"@lookiero/sty-psp-segment": "^0.1.1",
|
|
27
27
|
"@lookiero/sty-psp-storage": "^0.1.3",
|
|
28
28
|
"@lookiero/sty-psp-tracking": "^0.1.6",
|
|
29
|
-
"@lookiero/sty-psp-ui": "^0.5.5",
|
|
29
|
+
"@lookiero/sty-psp-ui": "^0.5.5-beta.0",
|
|
30
30
|
"@lookiero/sty-psp-ui-settings": "^0.1.1",
|
|
31
31
|
"@lookiero/sty-psp-units": "^0.1.1",
|
|
32
32
|
"@lookiero/sty-psp-uuid": "^0.1.0",
|
|
@@ -33,181 +33,172 @@ exports[`CheckoutHeader template matches the snapshot 1`] = `
|
|
|
33
33
|
style={
|
|
34
34
|
[
|
|
35
35
|
{
|
|
36
|
+
"alignItems": "center",
|
|
37
|
+
"backgroundColor": "#FFFFFF",
|
|
38
|
+
"flexDirection": "row",
|
|
39
|
+
"flexGrow": 0,
|
|
40
|
+
"flexWrap": "nowrap",
|
|
41
|
+
"height": 48,
|
|
42
|
+
"justifyContent": "space-between",
|
|
43
|
+
"overflow": "visible",
|
|
44
|
+
"paddingHorizontal": 8,
|
|
36
45
|
"width": "100%",
|
|
37
46
|
},
|
|
47
|
+
undefined,
|
|
38
48
|
]
|
|
39
49
|
}
|
|
50
|
+
testID="checkout-header"
|
|
40
51
|
>
|
|
41
52
|
<View
|
|
53
|
+
accessibilityRole="button"
|
|
54
|
+
accessibilityState={
|
|
55
|
+
{
|
|
56
|
+
"busy": undefined,
|
|
57
|
+
"checked": undefined,
|
|
58
|
+
"disabled": undefined,
|
|
59
|
+
"expanded": undefined,
|
|
60
|
+
"selected": undefined,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
accessibilityValue={
|
|
64
|
+
{
|
|
65
|
+
"max": undefined,
|
|
66
|
+
"min": undefined,
|
|
67
|
+
"now": undefined,
|
|
68
|
+
"text": undefined,
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
accessible={true}
|
|
72
|
+
collapsable={false}
|
|
73
|
+
focusable={true}
|
|
74
|
+
onBlur={[Function]}
|
|
75
|
+
onClick={[Function]}
|
|
76
|
+
onFocus={[Function]}
|
|
77
|
+
onResponderGrant={[Function]}
|
|
78
|
+
onResponderMove={[Function]}
|
|
79
|
+
onResponderRelease={[Function]}
|
|
80
|
+
onResponderTerminate={[Function]}
|
|
81
|
+
onResponderTerminationRequest={[Function]}
|
|
82
|
+
onStartShouldSetResponder={[Function]}
|
|
42
83
|
style={
|
|
43
84
|
[
|
|
85
|
+
[
|
|
86
|
+
{
|
|
87
|
+
"_container": {
|
|
88
|
+
"overflow": "hidden",
|
|
89
|
+
},
|
|
90
|
+
"_pressed": {
|
|
91
|
+
"bottom": 0,
|
|
92
|
+
"left": 0,
|
|
93
|
+
"right": 0,
|
|
94
|
+
"top": 0,
|
|
95
|
+
},
|
|
96
|
+
"alignSelf": "auto",
|
|
97
|
+
"container": {
|
|
98
|
+
"overflow": "hidden",
|
|
99
|
+
},
|
|
100
|
+
"height": 40,
|
|
101
|
+
"overflow": "visible",
|
|
102
|
+
"padding": 8,
|
|
103
|
+
"pressed": {
|
|
104
|
+
"bottom": 0,
|
|
105
|
+
"left": 0,
|
|
106
|
+
"right": 0,
|
|
107
|
+
"top": 0,
|
|
108
|
+
},
|
|
109
|
+
"width": 40,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
44
112
|
{
|
|
45
|
-
"
|
|
46
|
-
"backgroundColor": "#FFFFFF",
|
|
47
|
-
"flexDirection": "row",
|
|
48
|
-
"flexGrow": 0,
|
|
49
|
-
"flexWrap": "nowrap",
|
|
50
|
-
"justifyContent": "space-between",
|
|
51
|
-
"overflow": "visible",
|
|
52
|
-
"paddingHorizontal": 8,
|
|
53
|
-
"width": "100%",
|
|
113
|
+
"opacity": 1,
|
|
54
114
|
},
|
|
55
|
-
undefined,
|
|
56
115
|
]
|
|
57
116
|
}
|
|
58
|
-
testID="
|
|
117
|
+
testID="arrow-left-button-icon"
|
|
59
118
|
>
|
|
60
119
|
<View
|
|
61
|
-
accessibilityRole="button"
|
|
62
|
-
accessibilityState={
|
|
63
|
-
{
|
|
64
|
-
"busy": undefined,
|
|
65
|
-
"checked": undefined,
|
|
66
|
-
"disabled": undefined,
|
|
67
|
-
"expanded": undefined,
|
|
68
|
-
"selected": undefined,
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
accessibilityValue={
|
|
72
|
-
{
|
|
73
|
-
"max": undefined,
|
|
74
|
-
"min": undefined,
|
|
75
|
-
"now": undefined,
|
|
76
|
-
"text": undefined,
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
accessible={true}
|
|
80
|
-
collapsable={false}
|
|
81
|
-
focusable={true}
|
|
82
|
-
onBlur={[Function]}
|
|
83
|
-
onClick={[Function]}
|
|
84
|
-
onFocus={[Function]}
|
|
85
|
-
onResponderGrant={[Function]}
|
|
86
|
-
onResponderMove={[Function]}
|
|
87
|
-
onResponderRelease={[Function]}
|
|
88
|
-
onResponderTerminate={[Function]}
|
|
89
|
-
onResponderTerminationRequest={[Function]}
|
|
90
|
-
onStartShouldSetResponder={[Function]}
|
|
91
120
|
style={
|
|
92
121
|
[
|
|
93
|
-
[
|
|
94
|
-
{
|
|
95
|
-
"_container": {
|
|
96
|
-
"overflow": "hidden",
|
|
97
|
-
},
|
|
98
|
-
"_pressed": {
|
|
99
|
-
"bottom": 0,
|
|
100
|
-
"left": 0,
|
|
101
|
-
"right": 0,
|
|
102
|
-
"top": 0,
|
|
103
|
-
},
|
|
104
|
-
"alignSelf": "flex-start",
|
|
105
|
-
"container": {
|
|
106
|
-
"overflow": "hidden",
|
|
107
|
-
},
|
|
108
|
-
"height": 40,
|
|
109
|
-
"overflow": "visible",
|
|
110
|
-
"padding": 8,
|
|
111
|
-
"pressed": {
|
|
112
|
-
"bottom": 0,
|
|
113
|
-
"left": 0,
|
|
114
|
-
"right": 0,
|
|
115
|
-
"top": 0,
|
|
116
|
-
},
|
|
117
|
-
"width": 40,
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
122
|
{
|
|
121
|
-
"
|
|
123
|
+
"position": "relative",
|
|
122
124
|
},
|
|
123
125
|
]
|
|
124
126
|
}
|
|
125
|
-
testID="arrow-left-button-icon"
|
|
126
127
|
>
|
|
127
|
-
<
|
|
128
|
+
<Text
|
|
129
|
+
accessibilityElementsHidden={true}
|
|
130
|
+
allowFontScaling={false}
|
|
131
|
+
importantForAccessibility="no"
|
|
132
|
+
selectable={false}
|
|
128
133
|
style={
|
|
129
134
|
[
|
|
130
135
|
{
|
|
131
|
-
"
|
|
136
|
+
"color": "#0C0A0A",
|
|
137
|
+
"fontFamily": "auroraicons",
|
|
138
|
+
"fontSize": 24,
|
|
139
|
+
"fontStyle": "normal",
|
|
140
|
+
"fontWeight": "normal",
|
|
141
|
+
"height": 24,
|
|
142
|
+
"width": 24,
|
|
132
143
|
},
|
|
133
144
|
]
|
|
134
145
|
}
|
|
135
146
|
>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
147
|
+
|
|
148
|
+
</Text>
|
|
149
|
+
<View
|
|
150
|
+
collapsable={false}
|
|
151
|
+
style={
|
|
152
|
+
{
|
|
153
|
+
"backgroundColor": "#F45545",
|
|
154
|
+
"borderColor": "#FFFFFF",
|
|
155
|
+
"borderRadius": 9999,
|
|
156
|
+
"borderWidth": 2,
|
|
157
|
+
"height": 10,
|
|
158
|
+
"position": "absolute",
|
|
159
|
+
"right": 0,
|
|
160
|
+
"top": 0,
|
|
161
|
+
"transform": [
|
|
143
162
|
{
|
|
144
|
-
"
|
|
145
|
-
"fontFamily": "auroraicons",
|
|
146
|
-
"fontSize": 24,
|
|
147
|
-
"fontStyle": "normal",
|
|
148
|
-
"fontWeight": "normal",
|
|
149
|
-
"height": 24,
|
|
150
|
-
"width": 24,
|
|
163
|
+
"scale": 0,
|
|
151
164
|
},
|
|
152
|
-
]
|
|
153
|
-
|
|
154
|
-
>
|
|
155
|
-
|
|
156
|
-
</Text>
|
|
157
|
-
<View
|
|
158
|
-
collapsable={false}
|
|
159
|
-
style={
|
|
160
|
-
{
|
|
161
|
-
"backgroundColor": "#F45545",
|
|
162
|
-
"borderColor": "#FFFFFF",
|
|
163
|
-
"borderRadius": 9999,
|
|
164
|
-
"borderWidth": 2,
|
|
165
|
-
"height": 10,
|
|
166
|
-
"position": "absolute",
|
|
167
|
-
"right": 0,
|
|
168
|
-
"top": 0,
|
|
169
|
-
"transform": [
|
|
170
|
-
{
|
|
171
|
-
"scale": 0,
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
"width": 10,
|
|
175
|
-
}
|
|
165
|
+
],
|
|
166
|
+
"width": 10,
|
|
176
167
|
}
|
|
177
|
-
|
|
178
|
-
|
|
168
|
+
}
|
|
169
|
+
/>
|
|
179
170
|
</View>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"color": "#0C0A0A",
|
|
187
|
-
"fontFamily": "AreaNormal-Extrabold",
|
|
188
|
-
"fontSize": 15,
|
|
189
|
-
"letterSpacing": -0.2,
|
|
190
|
-
"lineHeight": 20,
|
|
191
|
-
"paddingBottom": 0,
|
|
192
|
-
"paddingLeft": 0,
|
|
193
|
-
"paddingRight": 0,
|
|
194
|
-
"paddingTop": 2,
|
|
195
|
-
},
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
>
|
|
199
|
-
header.complete_checkout_title
|
|
200
|
-
</Text>
|
|
201
|
-
<View
|
|
202
|
-
style={
|
|
171
|
+
</View>
|
|
172
|
+
<Text
|
|
173
|
+
allowFontScaling={false}
|
|
174
|
+
selectable={false}
|
|
175
|
+
style={
|
|
176
|
+
[
|
|
203
177
|
{
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
|
|
178
|
+
"color": "#0C0A0A",
|
|
179
|
+
"fontFamily": "AreaNormal-Extrabold",
|
|
180
|
+
"fontSize": 15,
|
|
181
|
+
"letterSpacing": -0.2,
|
|
182
|
+
"lineHeight": 20,
|
|
183
|
+
"paddingBottom": 0,
|
|
184
|
+
"paddingLeft": 0,
|
|
185
|
+
"paddingRight": 0,
|
|
186
|
+
"paddingTop": 2,
|
|
187
|
+
},
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
>
|
|
191
|
+
header.complete_checkout_title
|
|
192
|
+
</Text>
|
|
193
|
+
<View
|
|
194
|
+
style={
|
|
195
|
+
{
|
|
196
|
+
"flexGrow": 0,
|
|
197
|
+
"height": 40,
|
|
198
|
+
"width": 40,
|
|
208
199
|
}
|
|
209
|
-
|
|
210
|
-
|
|
200
|
+
}
|
|
201
|
+
/>
|
|
211
202
|
</View>
|
|
212
203
|
</View>
|
|
213
204
|
`;
|
|
@@ -38,6 +38,7 @@ exports[`ItemDetailHeader template matches the snapshot 1`] = `
|
|
|
38
38
|
"flexDirection": "row",
|
|
39
39
|
"flexGrow": 0,
|
|
40
40
|
"flexWrap": "nowrap",
|
|
41
|
+
"height": 48,
|
|
41
42
|
"justifyContent": "space-between",
|
|
42
43
|
"overflow": "visible",
|
|
43
44
|
"paddingHorizontal": 8,
|
|
@@ -122,10 +123,11 @@ exports[`ItemDetailHeader template matches the snapshot 1`] = `
|
|
|
122
123
|
"right": 0,
|
|
123
124
|
"top": 0,
|
|
124
125
|
},
|
|
125
|
-
"alignSelf": "
|
|
126
|
+
"alignSelf": "auto",
|
|
126
127
|
"container": {
|
|
127
128
|
"overflow": "hidden",
|
|
128
129
|
},
|
|
130
|
+
"height": 40,
|
|
129
131
|
"overflow": "visible",
|
|
130
132
|
"padding": 8,
|
|
131
133
|
"pressed": {
|
|
@@ -134,6 +136,7 @@ exports[`ItemDetailHeader template matches the snapshot 1`] = `
|
|
|
134
136
|
"right": 0,
|
|
135
137
|
"top": 0,
|
|
136
138
|
},
|
|
139
|
+
"width": 40,
|
|
137
140
|
},
|
|
138
141
|
],
|
|
139
142
|
{
|
|
@@ -38,6 +38,7 @@ exports[`ItemHeader template matches the snapshot 1`] = `
|
|
|
38
38
|
"flexDirection": "row",
|
|
39
39
|
"flexGrow": 0,
|
|
40
40
|
"flexWrap": "nowrap",
|
|
41
|
+
"height": 48,
|
|
41
42
|
"justifyContent": "space-between",
|
|
42
43
|
"overflow": "visible",
|
|
43
44
|
"paddingHorizontal": 8,
|
|
@@ -92,7 +93,7 @@ exports[`ItemHeader template matches the snapshot 1`] = `
|
|
|
92
93
|
"right": 0,
|
|
93
94
|
"top": 0,
|
|
94
95
|
},
|
|
95
|
-
"alignSelf": "
|
|
96
|
+
"alignSelf": "auto",
|
|
96
97
|
"container": {
|
|
97
98
|
"overflow": "hidden",
|
|
98
99
|
},
|
|
@@ -233,7 +234,7 @@ exports[`ItemHeader template matches the snapshot 1`] = `
|
|
|
233
234
|
"right": 0,
|
|
234
235
|
"top": 0,
|
|
235
236
|
},
|
|
236
|
-
"alignSelf": "
|
|
237
|
+
"alignSelf": "auto",
|
|
237
238
|
"container": {
|
|
238
239
|
"overflow": "hidden",
|
|
239
240
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StyleSheet, Platform } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
|
|
3
4
|
|
|
4
|
-
const { borderRadius4, colorBgPrimaryLight, colorBgBase, space4, space6, space12, space16
|
|
5
|
+
const { borderRadius4, colorBgPrimaryLight, colorBgBase, space3, space4, space6, space12, space16 } = theme();
|
|
5
6
|
|
|
6
7
|
const style = StyleSheet.create({
|
|
7
8
|
contentWrapper: {
|
|
@@ -23,19 +24,25 @@ const style = StyleSheet.create({
|
|
|
23
24
|
desktopResume: {
|
|
24
25
|
borderRadius: borderRadius4,
|
|
25
26
|
},
|
|
27
|
+
header: {
|
|
28
|
+
height: HEADER_HEIGHT,
|
|
29
|
+
},
|
|
26
30
|
paymentSelector: {
|
|
27
31
|
marginTop: space6,
|
|
28
32
|
},
|
|
29
33
|
princingWrapper: {
|
|
30
34
|
padding: space6,
|
|
31
35
|
},
|
|
36
|
+
princingWrapperSmall: {
|
|
37
|
+
backgroundColor: colorBgPrimaryLight,
|
|
38
|
+
},
|
|
32
39
|
resume: {
|
|
33
40
|
overflow: "hidden",
|
|
34
41
|
backgroundColor: colorBgBase,
|
|
35
42
|
...Platform.select({
|
|
36
43
|
web: {
|
|
37
44
|
position: "sticky",
|
|
38
|
-
top:
|
|
45
|
+
top: space12,
|
|
39
46
|
alignSelf: "flex-start",
|
|
40
47
|
},
|
|
41
48
|
}),
|
|
@@ -43,6 +50,11 @@ const style = StyleSheet.create({
|
|
|
43
50
|
} as any,
|
|
44
51
|
scrollView: {
|
|
45
52
|
backgroundColor: colorBgPrimaryLight,
|
|
53
|
+
flex: 1,
|
|
54
|
+
},
|
|
55
|
+
sticky: {
|
|
56
|
+
paddingBottom: space4,
|
|
57
|
+
paddingTop: space3,
|
|
46
58
|
},
|
|
47
59
|
title: {
|
|
48
60
|
marginBottom: space4,
|
|
@@ -2,13 +2,13 @@ import { fireEvent } from "@testing-library/react-native";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
4
4
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
|
+
import { DummyLayout } from "@lookiero/sty-psp-ui";
|
|
5
6
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
7
|
import { Country } from "../../../../projection/shared/country";
|
|
7
8
|
import { checkout } from "../../../projection/checkout/checkout.mock";
|
|
8
9
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
9
10
|
import { pricing } from "../../../projection/pricing/pricing.mock";
|
|
10
11
|
import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
|
|
11
|
-
import { DummyLayout } from "../../components/layouts/layout/dummyLayout/DummyLayout";
|
|
12
12
|
import { I18nMessages } from "../../i18n/i18n";
|
|
13
13
|
import { Routes } from "../../routing/routes";
|
|
14
14
|
import { render } from "../../test/render";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { FC, ReactNode, useCallback, useMemo } from "react";
|
|
2
|
-
import { View } from "react-native";
|
|
1
|
+
import React, { FC, ReactNode, useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { LayoutRectangle, Platform, ScrollView, View } from "react-native";
|
|
3
3
|
import { useNavigate } from "react-router-native";
|
|
4
4
|
import { Box, Button, Layout, Spinner, Text, useDevice } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
7
|
-
import { Layout as LocalLayout } from "@lookiero/sty-psp-ui";
|
|
7
|
+
import { Layout as LocalLayout, Sticky } from "@lookiero/sty-psp-ui";
|
|
8
8
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
9
9
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
10
10
|
import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
|
|
@@ -12,6 +12,7 @@ import { TrackingPage } from "../../../tracking/tracking";
|
|
|
12
12
|
import { useTrackPageView } from "../../../tracking/useTrackPageView";
|
|
13
13
|
import { useTrackPressBack } from "../../../tracking/useTrackPressBack";
|
|
14
14
|
import { useTrackPressContinue } from "../../../tracking/useTrackPressContinue";
|
|
15
|
+
import { Body } from "../../components/layouts/body/Body";
|
|
15
16
|
import { CheckoutHeader } from "../../components/templates/header/checkoutHeader/CheckoutHeader";
|
|
16
17
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
17
18
|
import { I18nMessages } from "../../i18n/i18n";
|
|
@@ -36,6 +37,8 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: LocalLayout, useRedirec
|
|
|
36
37
|
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
|
|
37
38
|
const submitButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
|
|
38
39
|
const { screen } = useDevice();
|
|
40
|
+
const [pricingHeight, setPricingHeight] = useState(0);
|
|
41
|
+
const handleOnPricingLayout = useCallback(({ height }: LayoutRectangle) => setPricingHeight(height), []);
|
|
39
42
|
|
|
40
43
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
41
44
|
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id as string });
|
|
@@ -98,54 +101,75 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: LocalLayout, useRedirec
|
|
|
98
101
|
return (
|
|
99
102
|
<LocalLayout
|
|
100
103
|
header={<CheckoutHeader onBack={handleOnBack} />}
|
|
104
|
+
scrollEnabled={false}
|
|
101
105
|
style={{
|
|
106
|
+
header: style.header,
|
|
102
107
|
scrollView: style.scrollView,
|
|
103
108
|
}}
|
|
104
109
|
>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
{
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
checkoutItem.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
110
|
+
<ScrollView showsVerticalScrollIndicator={false}>
|
|
111
|
+
{hasReplacedCheckoutItem && <DeliveryBanner />}
|
|
112
|
+
|
|
113
|
+
<Layout
|
|
114
|
+
fullWidth={!screen.L}
|
|
115
|
+
style={[screen.L && style.desktopLayoutSpacing, !screen.L && { paddingBottom: pricingHeight }]}
|
|
116
|
+
>
|
|
117
|
+
<Box size={{ L: "2/3" }} style={screen.L && style.desktopListSpacing}>
|
|
118
|
+
<View style={[style.contentWrapper, screen.L && style.desktopContentWrapper]}>
|
|
119
|
+
<Text level={3} style={style.title} heading>
|
|
120
|
+
{titleText}
|
|
121
|
+
</Text>
|
|
122
|
+
|
|
123
|
+
{checkoutItemsKept?.map((checkoutItem) => (
|
|
124
|
+
<View key={checkoutItem.id} testID="checkout-items-kept">
|
|
125
|
+
<ProductVariant
|
|
126
|
+
brand={checkoutItem.productVariant.brand}
|
|
127
|
+
color={checkoutItem.productVariant.color}
|
|
128
|
+
country={country}
|
|
129
|
+
media={checkoutItem.productVariant.media}
|
|
130
|
+
name={checkoutItem.productVariant.name}
|
|
131
|
+
price={checkoutItem.price}
|
|
132
|
+
status={checkoutItem.status}
|
|
133
|
+
size={
|
|
134
|
+
checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
|
|
135
|
+
? checkoutItem.replacedFor.size
|
|
136
|
+
: checkoutItem.productVariant.size
|
|
137
|
+
}
|
|
138
|
+
/>
|
|
139
|
+
</View>
|
|
140
|
+
))}
|
|
141
|
+
|
|
142
|
+
<View style={style.paymentSelector}>
|
|
143
|
+
<PaymentInstrument useRedirect={useRedirect} />
|
|
129
144
|
</View>
|
|
130
|
-
))}
|
|
131
|
-
|
|
132
|
-
<View style={style.paymentSelector}>
|
|
133
|
-
<PaymentInstrument useRedirect={useRedirect} />
|
|
134
|
-
</View>
|
|
135
|
-
</View>
|
|
136
|
-
</Box>
|
|
137
|
-
|
|
138
|
-
<Box size={{ L: "1/3" }} style={[style.resume, screen.L && style.desktopResume]}>
|
|
139
|
-
{pricing ? (
|
|
140
|
-
<View style={style.princingWrapper}>
|
|
141
|
-
<Pricing pricing={pricing} totalCheckoutItemsKept={checkoutItemsKept?.length || 0} />
|
|
142
|
-
<Button testID="confirm-checkout-button" onPress={handleOnSubmit}>
|
|
143
|
-
{submitButtonText}
|
|
144
|
-
</Button>
|
|
145
145
|
</View>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
</Box>
|
|
147
|
+
|
|
148
|
+
<Box size={{ L: "1/3" }} style={[style.resume, screen.L && style.desktopResume]}>
|
|
149
|
+
{pricing ? (
|
|
150
|
+
<View style={[style.princingWrapper, !screen.L && style.princingWrapperSmall]}>
|
|
151
|
+
<Pricing pricing={pricing} totalCheckoutItemsKept={checkoutItemsKept?.length || 0} />
|
|
152
|
+
|
|
153
|
+
{screen.L ? (
|
|
154
|
+
<Button testID="confirm-checkout-button" onPress={handleOnSubmit}>
|
|
155
|
+
{submitButtonText}
|
|
156
|
+
</Button>
|
|
157
|
+
) : null}
|
|
158
|
+
</View>
|
|
159
|
+
) : null}
|
|
160
|
+
</Box>
|
|
161
|
+
</Layout>
|
|
162
|
+
</ScrollView>
|
|
163
|
+
|
|
164
|
+
{pricing && !screen.L ? (
|
|
165
|
+
<Sticky style={style.sticky} onLayout={Platform.OS !== "web" ? handleOnPricingLayout : undefined}>
|
|
166
|
+
<Body>
|
|
167
|
+
<Button testID="confirm-checkout-button" small onPress={handleOnSubmit}>
|
|
168
|
+
{submitButtonText}
|
|
169
|
+
</Button>
|
|
170
|
+
</Body>
|
|
171
|
+
</Sticky>
|
|
172
|
+
) : null}
|
|
149
173
|
|
|
150
174
|
{children}
|
|
151
175
|
</LocalLayout>
|
|
@@ -2,6 +2,7 @@ import { fireEvent } from "@testing-library/react-native";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
4
4
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
|
+
import { DummyLayout } from "@lookiero/sty-psp-ui";
|
|
5
6
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
7
|
import { Country } from "../../../../projection/shared/country";
|
|
7
8
|
import { useGiveCheckoutFeedback } from "../../../domain/checkoutFeedback/react/useGiveCheckoutFeedback";
|
|
@@ -9,7 +10,6 @@ import { checkout } from "../../../projection/checkout/checkout.mock";
|
|
|
9
10
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
10
11
|
import { checkoutQuestions as checkoutQuestionsMock } from "../../../projection/checkoutQuestion/checkoutQuestions.mock";
|
|
11
12
|
import { useListCheckoutQuestionsByCheckoutId } from "../../../projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId";
|
|
12
|
-
import { DummyLayout } from "../../components/layouts/layout/dummyLayout/DummyLayout";
|
|
13
13
|
import { I18nMessages } from "../../i18n/i18n";
|
|
14
14
|
import { render } from "../../test/render";
|
|
15
15
|
import { Feedback } from "./Feedback";
|
|
@@ -2,6 +2,7 @@ import { fireEvent, RenderAPI, waitFor, screen, within } from "@testing-library/
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
4
4
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
|
+
import { DummyLayout } from "@lookiero/sty-psp-ui";
|
|
5
6
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
7
|
import { Country } from "../../../../projection/shared/country";
|
|
7
8
|
import { useBookCheckoutBookingForCheckoutItem } from "../../../domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem";
|
|
@@ -18,7 +19,6 @@ import { useViewIsSizeChangeEnabledByCheckoutId } from "../../../projection/chec
|
|
|
18
19
|
import { useListReturnQuestionsByCheckoutItemId } from "../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
|
|
19
20
|
import { returnQuestions as mockReturnQuestions } from "../../../projection/returnQuestion/returnQuestions.mock";
|
|
20
21
|
import { useTrackItemPageView } from "../../../tracking/useTrackItemPageView";
|
|
21
|
-
import { DummyLayout } from "../../components/layouts/layout/dummyLayout/DummyLayout";
|
|
22
22
|
import { I18nMessages } from "../../i18n/i18n";
|
|
23
23
|
import { render } from "../../test/render";
|
|
24
24
|
import { Item } from "./Item";
|
|
@@ -255,7 +255,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
|
|
|
255
255
|
header={header}
|
|
256
256
|
scrollEnabled={!itemWithoutCustomerDecission}
|
|
257
257
|
style={{
|
|
258
|
-
header: fiveItemsDiscount !== 0
|
|
258
|
+
header: fiveItemsDiscount !== 0 ? style.headerWithDoubleHeight : style.header,
|
|
259
259
|
scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
|
|
260
260
|
safeAreaView: isDesktopScreen ? style.safeAreaView : null,
|
|
261
261
|
}}
|
|
@@ -63,7 +63,7 @@ exports[`ProductVariant component matches the snapshot for a non-unique size: no
|
|
|
63
63
|
style={
|
|
64
64
|
{
|
|
65
65
|
"alignItems": "flex-end",
|
|
66
|
-
"borderBottomColor": "#
|
|
66
|
+
"borderBottomColor": "#F8F7F7",
|
|
67
67
|
"borderBottomWidth": 1,
|
|
68
68
|
"flexDirection": "row",
|
|
69
69
|
"justifyContent": "space-between",
|
|
@@ -306,7 +306,7 @@ exports[`ProductVariant component matches the snapshot for an unique size: uniqu
|
|
|
306
306
|
style={
|
|
307
307
|
{
|
|
308
308
|
"alignItems": "flex-end",
|
|
309
|
-
"borderBottomColor": "#
|
|
309
|
+
"borderBottomColor": "#F8F7F7",
|
|
310
310
|
"borderBottomWidth": 1,
|
|
311
311
|
"flexDirection": "row",
|
|
312
312
|
"justifyContent": "space-between",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Platform, StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
|
|
3
4
|
|
|
4
5
|
const {
|
|
5
6
|
colorTextMedium,
|
|
@@ -11,7 +12,6 @@ const {
|
|
|
11
12
|
space6,
|
|
12
13
|
space12,
|
|
13
14
|
space16,
|
|
14
|
-
space24,
|
|
15
15
|
borderRadius4,
|
|
16
16
|
colorBgBase,
|
|
17
17
|
} = theme();
|
|
@@ -39,6 +39,9 @@ const style = StyleSheet.create({
|
|
|
39
39
|
desktopResume: {
|
|
40
40
|
borderRadius: borderRadius4,
|
|
41
41
|
},
|
|
42
|
+
header: {
|
|
43
|
+
height: HEADER_HEIGHT,
|
|
44
|
+
},
|
|
42
45
|
mobileInfo: {
|
|
43
46
|
paddingHorizontal: space6,
|
|
44
47
|
paddingTop: space6,
|
|
@@ -64,7 +67,7 @@ const style = StyleSheet.create({
|
|
|
64
67
|
...Platform.select({
|
|
65
68
|
web: {
|
|
66
69
|
position: "sticky",
|
|
67
|
-
top:
|
|
70
|
+
top: space12,
|
|
68
71
|
alignSelf: "flex-start",
|
|
69
72
|
},
|
|
70
73
|
}),
|
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Text } from "react-native";
|
|
4
4
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
5
5
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
6
|
+
import { DummyLayout } from "@lookiero/sty-psp-ui";
|
|
6
7
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
7
8
|
import { Country } from "../../../../projection/shared/country";
|
|
8
9
|
import { checkout } from "../../../projection/checkout/checkout.mock";
|
|
@@ -10,7 +11,6 @@ import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/c
|
|
|
10
11
|
import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
|
|
11
12
|
import { pricing } from "../../../projection/pricing/pricing.mock";
|
|
12
13
|
import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
|
|
13
|
-
import { DummyLayout } from "../../components/layouts/layout/dummyLayout/DummyLayout";
|
|
14
14
|
import { I18nMessages } from "../../i18n/i18n";
|
|
15
15
|
import { render } from "../../test/render";
|
|
16
16
|
import { Summary } from "./Summary";
|
|
@@ -4,7 +4,7 @@ import { PricingProjection } from "../../../../../../projection/pricing/pricing"
|
|
|
4
4
|
import { pricing as pricingFunction } from "../../../../../projection/pricing/pricing.mock";
|
|
5
5
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
6
6
|
import { render } from "../../../../test/render";
|
|
7
|
-
import {
|
|
7
|
+
import { CollapsiblePricing } from "./CollapsiblePricing";
|
|
8
8
|
|
|
9
9
|
const mockOnPress = jest.fn();
|
|
10
10
|
const mockOnSubmit = jest.fn();
|
|
@@ -25,7 +25,7 @@ const renderPricing: RenderPricingFunction = ({
|
|
|
25
25
|
pricing = pricingFunction(),
|
|
26
26
|
} = {}) =>
|
|
27
27
|
render(
|
|
28
|
-
<
|
|
28
|
+
<CollapsiblePricing
|
|
29
29
|
collapsed={collapsed}
|
|
30
30
|
collapsible={collapsible}
|
|
31
31
|
pricing={pricing}
|
|
@@ -51,10 +51,15 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
51
51
|
"paddingHorizontal": 24,
|
|
52
52
|
},
|
|
53
53
|
false,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
"borderBottomColor": "#DAD8D8",
|
|
57
|
+
"borderBottomWidth": 1,
|
|
58
|
+
"justifyContent": "flex-start",
|
|
59
|
+
"paddingHorizontal": 16,
|
|
60
|
+
},
|
|
61
|
+
false,
|
|
62
|
+
],
|
|
58
63
|
]
|
|
59
64
|
}
|
|
60
65
|
testID="tab-list"
|
|
@@ -109,9 +114,9 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
109
114
|
{
|
|
110
115
|
"color": "#0C0A0A",
|
|
111
116
|
"fontFamily": "AreaNormal-Extrabold",
|
|
112
|
-
"fontSize":
|
|
117
|
+
"fontSize": 13,
|
|
113
118
|
"letterSpacing": -0.2,
|
|
114
|
-
"lineHeight":
|
|
119
|
+
"lineHeight": 17,
|
|
115
120
|
"paddingBottom": 0,
|
|
116
121
|
"paddingLeft": 0,
|
|
117
122
|
"paddingRight": 0,
|
|
@@ -173,9 +178,9 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
173
178
|
{
|
|
174
179
|
"color": "#837C7C",
|
|
175
180
|
"fontFamily": "AreaNormal-Extrabold",
|
|
176
|
-
"fontSize":
|
|
181
|
+
"fontSize": 13,
|
|
177
182
|
"letterSpacing": -0.2,
|
|
178
|
-
"lineHeight":
|
|
183
|
+
"lineHeight": 17,
|
|
179
184
|
"paddingBottom": 0,
|
|
180
185
|
"paddingLeft": 0,
|
|
181
186
|
"paddingRight": 0,
|
|
@@ -211,7 +216,8 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
211
216
|
style={
|
|
212
217
|
{
|
|
213
218
|
"opacity": 0,
|
|
214
|
-
"
|
|
219
|
+
"paddingBottom": 24,
|
|
220
|
+
"paddingHorizontal": 24,
|
|
215
221
|
"paddingTop": 8,
|
|
216
222
|
}
|
|
217
223
|
}
|
|
@@ -342,7 +348,7 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
342
348
|
style={
|
|
343
349
|
{
|
|
344
350
|
"alignItems": "flex-end",
|
|
345
|
-
"borderBottomColor": "#
|
|
351
|
+
"borderBottomColor": "#F8F7F7",
|
|
346
352
|
"borderBottomWidth": 1,
|
|
347
353
|
"flexDirection": "row",
|
|
348
354
|
"justifyContent": "space-between",
|
|
@@ -557,7 +563,7 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
557
563
|
style={
|
|
558
564
|
{
|
|
559
565
|
"alignItems": "flex-end",
|
|
560
|
-
"borderBottomColor": "#
|
|
566
|
+
"borderBottomColor": "#F8F7F7",
|
|
561
567
|
"borderBottomWidth": 1,
|
|
562
568
|
"flexDirection": "row",
|
|
563
569
|
"justifyContent": "space-between",
|
|
@@ -821,7 +827,7 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
821
827
|
style={
|
|
822
828
|
{
|
|
823
829
|
"alignItems": "flex-end",
|
|
824
|
-
"borderBottomColor": "#
|
|
830
|
+
"borderBottomColor": "#F8F7F7",
|
|
825
831
|
"borderBottomWidth": 1,
|
|
826
832
|
"flexDirection": "row",
|
|
827
833
|
"justifyContent": "space-between",
|
|
@@ -1036,7 +1042,7 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
1036
1042
|
style={
|
|
1037
1043
|
{
|
|
1038
1044
|
"alignItems": "flex-end",
|
|
1039
|
-
"borderBottomColor": "#
|
|
1045
|
+
"borderBottomColor": "#F8F7F7",
|
|
1040
1046
|
"borderBottomWidth": 1,
|
|
1041
1047
|
"flexDirection": "row",
|
|
1042
1048
|
"justifyContent": "space-between",
|