@lookiero/checkout 6.5.0-beta.1 → 6.5.0-beta.3

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.
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
- import { View } from "react-native";
3
2
  import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
4
3
  import { Box, Spinner } from "@lookiero/aurora";
5
4
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
@@ -170,10 +169,11 @@ const Item = ({ layout: Layout }) => {
170
169
  return React.createElement(Spinner, { testID: "spinner" });
171
170
  }
172
171
  return (React.createElement(ReturnQuestionFeedbackProvider, { key: checkoutItem.id, feedback: checkoutItem.feedbacks || {} },
173
- React.createElement(Layout, { header: header, style: {
172
+ React.createElement(Layout, { header: header, scrollEnabled: !itemWithoutCustomerDecission, style: {
173
+ header: fiveItemsDiscount !== 0 && style.headerWithDoubleHeight,
174
+ scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
174
175
  safeAreaView: isDesktopScreen ? style.safeAreaView : null,
175
- } },
176
- React.createElement(View, { style: [style.content, fiveItemsDiscount !== 0 && style.fiveItemsDiscountPadding] }, 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 })))),
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 }))),
177
177
  !redirectToReturnPage ? (React.createElement(ReturnQuestionsForm, { returnQuestions: returnQuestions, visible: returnQuestionsVisible, onClose: hideReturnQuestions, onSubmit: returnItem })) : null));
178
178
  };
179
179
  export { Item };
@@ -1,10 +1,10 @@
1
1
  declare const style: {
2
- content: {
3
- flex: number;
4
- };
5
2
  fiveItemsDiscountPadding: {
6
3
  paddingTop: number;
7
4
  };
5
+ headerWithDoubleHeight: {
6
+ height: number;
7
+ };
8
8
  headerWrapper: {
9
9
  display: "flex";
10
10
  flexDirection: "column";
@@ -1,13 +1,14 @@
1
1
  import { 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
  const { colorBgPrimaryLight, space12 } = theme();
4
5
  const style = StyleSheet.create({
5
- content: {
6
- flex: 1,
7
- },
8
6
  fiveItemsDiscountPadding: {
9
7
  paddingTop: space12,
10
8
  },
9
+ headerWithDoubleHeight: {
10
+ height: HEADER_HEIGHT * 2,
11
+ },
11
12
  headerWrapper: {
12
13
  display: "flex",
13
14
  flexDirection: "column",
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useState } from "react";
2
- import { Platform } from "react-native";
2
+ import { Platform, ScrollView } from "react-native";
3
3
  import { Spinner } from "@lookiero/aurora";
4
4
  import { CommandStatus } from "@lookiero/messaging-react";
5
5
  import { useLogger } from "@lookiero/sty-psp-logging";
@@ -63,8 +63,9 @@ const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProducts
63
63
  }
64
64
  return (React.createElement(React.Fragment, null,
65
65
  React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
66
- React.createElement(Body, { style: { row: style.container } },
67
- React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, style: { content: { paddingBottom: Platform.OS === "web" ? space6 : stickyHeight } } })),
66
+ React.createElement(ScrollView, { showsVerticalScrollIndicator: false },
67
+ React.createElement(Body, { style: { row: style.container } },
68
+ React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, style: { content: { paddingBottom: Platform.OS === "web" ? space6 : stickyHeight } } }))),
68
69
  React.createElement(ItemActions, { country: country, currentProductVariant: currentProductVariant, productVariants: bookedProductsVariants?.productVariants, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: onReturn, onShowSizeWithoutStockModal: handleOnShowSizeWithoutStockModal })));
69
70
  };
70
71
  export { ItemWithoutCustomerDecission };
@@ -1,6 +1,5 @@
1
1
  declare const style: {
2
2
  container: {
3
- justifyContent: "flex-start";
4
3
  paddingBottom: number;
5
4
  paddingHorizontal: number;
6
5
  };
@@ -3,7 +3,7 @@ import { theme } from "@lookiero/sty-psp-ui";
3
3
  const { space10 } = theme();
4
4
  const style = StyleSheet.create({
5
5
  container: {
6
- justifyContent: "flex-start",
6
+ // justifyContent: "flex-start",
7
7
  paddingBottom: space10,
8
8
  paddingHorizontal: 0,
9
9
  },
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from "react";
2
- import { Platform, View } from "react-native";
2
+ import { Platform, ScrollView, View } from "react-native";
3
3
  import { generatePath, useMatch, useNavigate } from "react-router-native";
4
4
  import { Box, Text, Layout, useDevice, Spinner } from "@lookiero/aurora";
5
5
  import { useI18nMessage } from "@lookiero/i18n-react";
@@ -79,20 +79,21 @@ const Summary = ({ layout: LocalLayout, children }) => {
79
79
  if (!dependenciesLoaded) {
80
80
  return React.createElement(Spinner, null);
81
81
  }
82
- return (React.createElement(LocalLayout, { style: {
82
+ return (React.createElement(LocalLayout, { scrollEnabled: false, style: {
83
83
  scrollView: style.scrollView,
84
84
  } },
85
- fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
86
- React.createElement(Layout, { fullWidth: !screen.L, style: [screen.L && style.desktopLayoutSpacing, !screen.L && { paddingBottom: pricingHeight }] },
87
- React.createElement(Box, { size: { L: "2/3" }, style: screen.L && style.desktopListSpacing },
88
- React.createElement(View, { style: [style.contentWrapper, screen.L && style.desktopContentWrapper] },
89
- React.createElement(View, { style: !screen.L && style.mobileInfo },
90
- React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
91
- React.createElement(Text, { level: 3, style: style.description }, descriptionText)),
92
- children)),
93
- pricing && screen.L ? (React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L ? style.desktopResume : style.mobileResume] },
94
- React.createElement(View, { style: style.princingWrapper },
95
- React.createElement(CollapsiblePricing, { collapsed: false, collapsible: false, pricing: pricing, submitButtonText: submitButtonText, totalCheckoutItemsKept: totalCheckoutItemsKept, onSubmit: handleOnSubmit })))) : null),
85
+ React.createElement(ScrollView, { showsVerticalScrollIndicator: false },
86
+ fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
87
+ React.createElement(Layout, { fullWidth: !screen.L, style: [screen.L && style.desktopLayoutSpacing, !screen.L && { paddingBottom: pricingHeight }] },
88
+ React.createElement(Box, { size: { L: "2/3" }, style: screen.L && style.desktopListSpacing },
89
+ React.createElement(View, { style: [style.contentWrapper, screen.L && style.desktopContentWrapper] },
90
+ React.createElement(View, { style: !screen.L && style.mobileInfo },
91
+ React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
92
+ React.createElement(Text, { level: 3, style: style.description }, descriptionText)),
93
+ children)),
94
+ pricing && screen.L ? (React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L ? style.desktopResume : style.mobileResume] },
95
+ React.createElement(View, { style: style.princingWrapper },
96
+ React.createElement(CollapsiblePricing, { collapsed: false, collapsible: false, pricing: pricing, submitButtonText: submitButtonText, totalCheckoutItemsKept: totalCheckoutItemsKept, onSubmit: handleOnSubmit })))) : null)),
96
97
  pricing && !screen.L ? (React.createElement(Sticky, { style: style.sticky, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined },
97
98
  React.createElement(Body, null,
98
99
  React.createElement(CollapsiblePricing, { collapsed: pricingCollapsed, pricing: pricing, submitButtonText: submitButtonText, totalCheckoutItemsKept: totalCheckoutItemsKept, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })))) : null));
@@ -32,6 +32,7 @@ declare const style: {
32
32
  resume: any;
33
33
  scrollView: {
34
34
  backgroundColor: string;
35
+ flex: number;
35
36
  };
36
37
  sticky: {
37
38
  paddingBottom: number;
@@ -57,6 +57,7 @@ const style = StyleSheet.create({
57
57
  },
58
58
  scrollView: {
59
59
  backgroundColor: colorBgPrimaryLight,
60
+ flex: 1,
60
61
  },
61
62
  sticky: {
62
63
  paddingBottom: space4,
@@ -1 +1 @@
1
- export declare const VERSION = "6.5.0-beta.1";
1
+ export declare const VERSION = "6.5.0-beta.3";
@@ -1 +1 @@
1
- export const VERSION = "6.5.0-beta.1";
1
+ export const VERSION = "6.5.0-beta.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "6.5.0-beta.1",
3
+ "version": "6.5.0-beta.3",
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.7",
24
+ "@lookiero/sty-psp-notifications": "^0.5.8",
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.4",
29
+ "@lookiero/sty-psp-ui": "^0.5.5",
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",
@@ -1,15 +1,16 @@
1
1
  import { 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 { colorBgPrimaryLight, space12 } = theme();
5
6
 
6
7
  const style = StyleSheet.create({
7
- content: {
8
- flex: 1,
9
- },
10
8
  fiveItemsDiscountPadding: {
11
9
  paddingTop: space12,
12
10
  },
11
+ headerWithDoubleHeight: {
12
+ height: HEADER_HEIGHT * 2,
13
+ },
13
14
  headerWrapper: {
14
15
  display: "flex",
15
16
  flexDirection: "column",
@@ -1,5 +1,4 @@
1
1
  import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from "react";
2
- import { View } from "react-native";
3
2
  import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
4
3
  import { Box, Spinner } from "@lookiero/aurora";
5
4
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
@@ -254,29 +253,30 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
254
253
  <ReturnQuestionFeedbackProvider key={checkoutItem.id} feedback={checkoutItem.feedbacks || {}}>
255
254
  <Layout
256
255
  header={header}
256
+ scrollEnabled={!itemWithoutCustomerDecission}
257
257
  style={{
258
+ header: fiveItemsDiscount !== 0 && style.headerWithDoubleHeight,
259
+ scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
258
260
  safeAreaView: isDesktopScreen ? style.safeAreaView : null,
259
261
  }}
260
262
  >
261
- <View style={[style.content, fiveItemsDiscount !== 0 && style.fiveItemsDiscountPadding]}>
262
- {itemWithoutCustomerDecission ? (
263
- <ItemWithoutCustomerDecission
264
- bookedProductsVariants={bookedProductsVariants as BookedProductsVariantsProjection}
265
- checkoutId={checkout.id}
266
- checkoutItem={checkoutItem as CheckoutItemWithoutCustomerDecission}
267
- currentProductVariant={currentProductVariant}
268
- onReturn={redirectToReturnPage ? goToReturnPage : showReturnQuestions}
269
- />
270
- ) : (
271
- <ItemWithCustomerDecission
272
- checkoutId={checkout.id}
273
- checkoutItem={checkoutItem as CheckoutItemWithCustomerDecission}
274
- currentProductVariant={currentProductVariant}
275
- returnQuestions={returnQuestions}
276
- onEditFeedback={redirectToReturnPage ? goToReturnPage : showReturnQuestions}
277
- />
278
- )}
279
- </View>
263
+ {itemWithoutCustomerDecission ? (
264
+ <ItemWithoutCustomerDecission
265
+ bookedProductsVariants={bookedProductsVariants as BookedProductsVariantsProjection}
266
+ checkoutId={checkout.id}
267
+ checkoutItem={checkoutItem as CheckoutItemWithoutCustomerDecission}
268
+ currentProductVariant={currentProductVariant}
269
+ onReturn={redirectToReturnPage ? goToReturnPage : showReturnQuestions}
270
+ />
271
+ ) : (
272
+ <ItemWithCustomerDecission
273
+ checkoutId={checkout.id}
274
+ checkoutItem={checkoutItem as CheckoutItemWithCustomerDecission}
275
+ currentProductVariant={currentProductVariant}
276
+ returnQuestions={returnQuestions}
277
+ onEditFeedback={redirectToReturnPage ? goToReturnPage : showReturnQuestions}
278
+ />
279
+ )}
280
280
  </Layout>
281
281
 
282
282
  {!redirectToReturnPage ? (
@@ -5,7 +5,7 @@ const { space10 } = theme();
5
5
 
6
6
  const style = StyleSheet.create({
7
7
  container: {
8
- justifyContent: "flex-start",
8
+ // justifyContent: "flex-start",
9
9
  paddingBottom: space10,
10
10
  paddingHorizontal: 0,
11
11
  },
@@ -1,5 +1,5 @@
1
1
  import React, { FC, useCallback, useState } from "react";
2
- import { LayoutRectangle, Platform } from "react-native";
2
+ import { LayoutRectangle, Platform, ScrollView } from "react-native";
3
3
  import { Spinner } from "@lookiero/aurora";
4
4
  import { CommandStatus } from "@lookiero/messaging-react";
5
5
  import { useLogger } from "@lookiero/sty-psp-logging";
@@ -104,16 +104,18 @@ const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
104
104
  <>
105
105
  <SizeWithoutStockModal visible={sizeWithoutStockModalVisible} onDismiss={handleOnHideSizeWithoutStockModal} />
106
106
 
107
- <Body style={{ row: style.container }}>
108
- <ProductVariant
109
- checkoutId={checkoutId}
110
- checkoutItem={checkoutItem}
111
- country={country}
112
- currentProductVariant={currentProductVariant}
113
- segment={segment}
114
- style={{ content: { paddingBottom: Platform.OS === "web" ? space6 : stickyHeight } }}
115
- />
116
- </Body>
107
+ <ScrollView showsVerticalScrollIndicator={false}>
108
+ <Body style={{ row: style.container }}>
109
+ <ProductVariant
110
+ checkoutId={checkoutId}
111
+ checkoutItem={checkoutItem}
112
+ country={country}
113
+ currentProductVariant={currentProductVariant}
114
+ segment={segment}
115
+ style={{ content: { paddingBottom: Platform.OS === "web" ? space6 : stickyHeight } }}
116
+ />
117
+ </Body>
118
+ </ScrollView>
117
119
 
118
120
  <ItemActions
119
121
  country={country}
@@ -72,6 +72,7 @@ const style = StyleSheet.create({
72
72
  } as any,
73
73
  scrollView: {
74
74
  backgroundColor: colorBgPrimaryLight,
75
+ flex: 1,
75
76
  },
76
77
  sticky: {
77
78
  paddingBottom: space4,
@@ -1,5 +1,5 @@
1
1
  import React, { FC, ReactNode, useCallback, useEffect, useMemo, useState } from "react";
2
- import { LayoutRectangle, Platform, View } from "react-native";
2
+ import { LayoutRectangle, Platform, ScrollView, View } from "react-native";
3
3
  import { generatePath, useMatch, useNavigate } from "react-router-native";
4
4
  import { Box, Text, Layout, useDevice, Spinner } from "@lookiero/aurora";
5
5
  import { useI18nMessage } from "@lookiero/i18n-react";
@@ -111,45 +111,49 @@ const Summary: FC<SummaryProps> = ({ layout: LocalLayout, children }) => {
111
111
 
112
112
  return (
113
113
  <LocalLayout
114
+ scrollEnabled={false}
114
115
  style={{
115
116
  scrollView: style.scrollView,
116
117
  }}
117
118
  >
118
- {fiveItemsDiscount !== 0 && <FiveItemsDiscountBanner fiveItemsDiscount={fiveItemsDiscount} />}
119
-
120
- <Layout
121
- fullWidth={!screen.L}
122
- style={[screen.L && style.desktopLayoutSpacing, !screen.L && { paddingBottom: pricingHeight }]}
123
- >
124
- <Box size={{ L: "2/3" }} style={screen.L && style.desktopListSpacing}>
125
- <View style={[style.contentWrapper, screen.L && style.desktopContentWrapper]}>
126
- <View style={!screen.L && style.mobileInfo}>
127
- <Text level={3} style={style.title} heading>
128
- {titleText}
129
- </Text>
130
- <Text level={3} style={style.description}>
131
- {descriptionText}
132
- </Text>
133
- </View>
134
-
135
- {children}
136
- </View>
137
- </Box>
138
- {pricing && screen.L ? (
139
- <Box size={{ L: "1/3" }} style={[style.resume, screen.L ? style.desktopResume : style.mobileResume]}>
140
- <View style={style.princingWrapper}>
141
- <CollapsiblePricing
142
- collapsed={false}
143
- collapsible={false}
144
- pricing={pricing}
145
- submitButtonText={submitButtonText}
146
- totalCheckoutItemsKept={totalCheckoutItemsKept}
147
- onSubmit={handleOnSubmit}
148
- />
119
+ <ScrollView showsVerticalScrollIndicator={false}>
120
+ {fiveItemsDiscount !== 0 && <FiveItemsDiscountBanner fiveItemsDiscount={fiveItemsDiscount} />}
121
+
122
+ <Layout
123
+ fullWidth={!screen.L}
124
+ style={[screen.L && style.desktopLayoutSpacing, !screen.L && { paddingBottom: pricingHeight }]}
125
+ >
126
+ <Box size={{ L: "2/3" }} style={screen.L && style.desktopListSpacing}>
127
+ <View style={[style.contentWrapper, screen.L && style.desktopContentWrapper]}>
128
+ <View style={!screen.L && style.mobileInfo}>
129
+ <Text level={3} style={style.title} heading>
130
+ {titleText}
131
+ </Text>
132
+ <Text level={3} style={style.description}>
133
+ {descriptionText}
134
+ </Text>
135
+ </View>
136
+
137
+ {children}
149
138
  </View>
150
139
  </Box>
151
- ) : null}
152
- </Layout>
140
+
141
+ {pricing && screen.L ? (
142
+ <Box size={{ L: "1/3" }} style={[style.resume, screen.L ? style.desktopResume : style.mobileResume]}>
143
+ <View style={style.princingWrapper}>
144
+ <CollapsiblePricing
145
+ collapsed={false}
146
+ collapsible={false}
147
+ pricing={pricing}
148
+ submitButtonText={submitButtonText}
149
+ totalCheckoutItemsKept={totalCheckoutItemsKept}
150
+ onSubmit={handleOnSubmit}
151
+ />
152
+ </View>
153
+ </Box>
154
+ ) : null}
155
+ </Layout>
156
+ </ScrollView>
153
157
 
154
158
  {pricing && !screen.L ? (
155
159
  <Sticky style={style.sticky} onLayout={Platform.OS !== "web" ? handleOnPricingLayout : undefined}>