@lookiero/checkout 8.13.1-beta.0 → 8.13.2-beta.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.
@@ -2,10 +2,11 @@ import { PortalHost } from "@gorhom/portal";
2
2
  import React, { useCallback, useMemo } from "react";
3
3
  import { ScrollView } from "react-native";
4
4
  import { generatePath, useNavigate } from "react-router-native";
5
- import { Box, Button, Layout as AuroraLayout, Spinner, Text, View, useDevice } from "@lookiero/aurora";
5
+ import { Box, Button, Layout as AuroraLayout, Spinner, Text, View } from "@lookiero/aurora";
6
6
  import { useI18nMessage } from "@lookiero/i18n-react";
7
7
  import { CommandStatus } from "@lookiero/messaging-react";
8
8
  import { useLogger } from "@lookiero/sty-psp-logging";
9
+ import { useScreenSize } from "@lookiero/sty-psp-ui";
9
10
  import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
10
11
  import { useReturnCheckoutItem } from "../../../../../domain/checkoutItem/react/useReturnCheckoutItem";
11
12
  import { useListReturnQuestionsByCheckoutItemId } from "../../../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
@@ -41,7 +42,8 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
41
42
  const navigate = useNavigate();
42
43
  const basePath = useBasePath();
43
44
  const logger = useLogger();
44
- const { screen } = useDevice();
45
+ const screenSize = useScreenSize();
46
+ const isDesktopScreen = screenSize !== "S";
45
47
  const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
46
48
  const descriptionText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_DESCRIPTION });
47
49
  const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
@@ -95,15 +97,15 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
95
97
  return (React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
96
98
  React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
97
99
  React.createElement(Layout, { header: header, scrollEnabled: false, style: {
98
- safeAreaView: style.safeAreaView,
99
- scrollView: style.scrollView,
100
100
  header: style.header,
101
+ scrollView: style.scrollView,
102
+ safeAreaView: isDesktopScreen ? style.safeAreaView : null,
101
103
  } },
102
104
  React.createElement(ProductVariantPreview, { country: country, item: checkoutItem }),
103
105
  React.createElement(ScrollView, { showsVerticalScrollIndicator: false, testID: "return-questions-form" },
104
- React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [style.layout, screen.L ? style.desktopLayoutSpacing : undefined] },
106
+ React.createElement(AuroraLayout, { fullWidth: !isDesktopScreen, style: [style.layout, isDesktopScreen ? style.desktopLayoutSpacing : undefined] },
105
107
  React.createElement(Box, { size: { L: "2/3" } },
106
- React.createElement(View, { style: [style.info, !screen.S && style.desktopInfo] },
108
+ React.createElement(View, { style: [style.info, isDesktopScreen && style.desktopInfo] },
107
109
  React.createElement(Text, { level: 3, heading: true }, titleText),
108
110
  React.createElement(Text, { level: 1, style: style.description, detail: true }, descriptionText)),
109
111
  React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
@@ -31,7 +31,7 @@ declare const style: {
31
31
  flex: number;
32
32
  };
33
33
  scrollView: {
34
- flex: number;
34
+ height: "100%";
35
35
  };
36
36
  submit: {
37
37
  backgroundColor: string;
@@ -35,7 +35,8 @@ const style = StyleSheet.create({
35
35
  flex: 1,
36
36
  },
37
37
  scrollView: {
38
- flex: 1,
38
+ // flex: 1,
39
+ height: "100%",
39
40
  },
40
41
  submit: {
41
42
  backgroundColor: colorBgBase,
@@ -1 +1 @@
1
- export declare const VERSION = "8.13.1-beta.0";
1
+ export declare const VERSION = "8.13.2-beta.0";
@@ -1 +1 @@
1
- export const VERSION = "8.13.1-beta.0";
1
+ export const VERSION = "8.13.2-beta.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "8.13.1-beta.0",
3
+ "version": "8.13.2-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -37,7 +37,8 @@ const style = StyleSheet.create({
37
37
  flex: 1,
38
38
  },
39
39
  scrollView: {
40
- flex: 1,
40
+ // flex: 1,
41
+ height: "100%",
41
42
  },
42
43
  submit: {
43
44
  backgroundColor: colorBgBase,
@@ -2,13 +2,13 @@ import { PortalHost } from "@gorhom/portal";
2
2
  import React, { FC, useCallback, useMemo } from "react";
3
3
  import { ScrollView } from "react-native";
4
4
  import { generatePath, useNavigate } from "react-router-native";
5
- import { Box, Button, Layout as AuroraLayout, Spinner, Text, View, useDevice } from "@lookiero/aurora";
5
+ import { Box, Button, Layout as AuroraLayout, Spinner, Text, View } from "@lookiero/aurora";
6
6
  import { useI18nMessage } from "@lookiero/i18n-react";
7
7
  import { CommandStatus } from "@lookiero/messaging-react";
8
8
  import { Country } from "@lookiero/sty-psp-locale";
9
9
  import { useLogger } from "@lookiero/sty-psp-logging";
10
10
  import { Segment } from "@lookiero/sty-psp-segment";
11
- import { Layout as UiLayout } from "@lookiero/sty-psp-ui";
11
+ import { Layout as UiLayout, useScreenSize } from "@lookiero/sty-psp-ui";
12
12
  import { CheckoutProjection } from "../../../../../../projection/checkout/checkout";
13
13
  import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
14
14
  import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
@@ -67,7 +67,8 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
67
67
  const basePath = useBasePath();
68
68
  const logger = useLogger();
69
69
 
70
- const { screen } = useDevice();
70
+ const screenSize = useScreenSize();
71
+ const isDesktopScreen = screenSize !== "S";
71
72
 
72
73
  const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
73
74
  const descriptionText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_DESCRIPTION });
@@ -145,17 +146,20 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
145
146
  header={header}
146
147
  scrollEnabled={false}
147
148
  style={{
148
- safeAreaView: style.safeAreaView,
149
- scrollView: style.scrollView,
150
149
  header: style.header,
150
+ scrollView: style.scrollView,
151
+ safeAreaView: isDesktopScreen ? style.safeAreaView : null,
151
152
  }}
152
153
  >
153
154
  <ProductVariantPreview country={country} item={checkoutItem} />
154
155
 
155
156
  <ScrollView showsVerticalScrollIndicator={false} testID="return-questions-form">
156
- <AuroraLayout fullWidth={!screen.L} style={[style.layout, screen.L ? style.desktopLayoutSpacing : undefined]}>
157
+ <AuroraLayout
158
+ fullWidth={!isDesktopScreen}
159
+ style={[style.layout, isDesktopScreen ? style.desktopLayoutSpacing : undefined]}
160
+ >
157
161
  <Box size={{ L: "2/3" }}>
158
- <View style={[style.info, !screen.S && style.desktopInfo]}>
162
+ <View style={[style.info, isDesktopScreen && style.desktopInfo]}>
159
163
  <Text level={3} heading>
160
164
  {titleText}
161
165
  </Text>