@lookiero/checkout 6.5.0 → 6.5.1

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,6 +2,7 @@ import React, { useCallback, useEffect, useRef } from "react";
2
2
  import { Spinner } from "@lookiero/aurora";
3
3
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
4
4
  import { useLogger } from "@lookiero/sty-psp-logging";
5
+ import { useScreenSize } from "@lookiero/sty-psp-ui";
5
6
  import { CheckoutQuestionType } from "../../../../projection/checkoutQuestion/checkoutQuestion";
6
7
  import { useGiveCheckoutFeedback } from "../../../domain/checkoutFeedback/react/useGiveCheckoutFeedback";
7
8
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
@@ -17,6 +18,8 @@ import { style } from "./Feedback.style";
17
18
  import { CheckoutQuestionsForm } from "./components/checkoutQuestionsForm/CheckoutQuestionsForm";
18
19
  const Feedback = ({ layout: Layout }) => {
19
20
  const logger = useLogger();
21
+ const screenSize = useScreenSize();
22
+ const isDesktop = screenSize === "L";
20
23
  const { customer: { customerId, country, segment }, } = useStaticInfo();
21
24
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
22
25
  const [checkoutQuestions, checkoutQuestionsStatus] = useListCheckoutQuestionsByCheckoutId({
@@ -78,8 +81,8 @@ const Feedback = ({ layout: Layout }) => {
78
81
  if (!dependenciesLoaded)
79
82
  return React.createElement(Spinner, null);
80
83
  return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {}, onChanged: handleOnChangedFeedback },
81
- React.createElement(Layout, { style: { scrollView: style.container } },
82
- React.createElement(Body, { style: { column: style.bodyColumn } },
84
+ React.createElement(Layout, null,
85
+ React.createElement(Body, { style: { row: [style.container, isDesktop && style.containerDesktop] } },
83
86
  React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
84
87
  };
85
88
  export { Feedback };
@@ -1,10 +1,11 @@
1
1
  declare const style: {
2
- bodyColumn: {
3
- paddingBottom: number;
2
+ container: {
3
+ justifyContent: "flex-start";
4
4
  paddingHorizontal: number;
5
+ paddingVertical: number;
5
6
  };
6
- container: {
7
- paddingBottom: number;
7
+ containerDesktop: {
8
+ paddingHorizontal: number;
8
9
  };
9
10
  };
10
11
  export { style };
@@ -1,13 +1,14 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
- const { space8, space10 } = theme();
3
+ const { space3, space6, space8 } = theme();
4
4
  const style = StyleSheet.create({
5
- bodyColumn: {
6
- paddingBottom: space8,
7
- paddingHorizontal: space8,
8
- },
9
5
  container: {
10
- paddingBottom: space10,
6
+ justifyContent: "flex-start",
7
+ paddingHorizontal: space6,
8
+ paddingVertical: space8,
9
+ },
10
+ containerDesktop: {
11
+ paddingHorizontal: space3,
11
12
  },
12
13
  });
13
14
  export { style };
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback, useMemo } from "react";
2
- import { View } from "react-native";
3
2
  import { Button } from "@lookiero/aurora";
4
3
  import { useI18nMessage } from "@lookiero/i18n-react";
5
4
  import { CheckoutQuestionType, } from "../../../../../../projection/checkoutQuestion/checkoutQuestion";
@@ -12,7 +11,6 @@ import { HostSelectCheckoutQuestionItem } from "../../../../components/organisms
12
11
  import { IconCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem";
13
12
  import { TextareaCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem";
14
13
  import { I18nMessages } from "../../../../i18n/i18n";
15
- import { style } from "./CheckoutQuestionsForm.style";
16
14
  const checkoutQuestionItems = {
17
15
  [CheckoutQuestionType.HOST_DEFAULT]: HostDefaultCheckoutQuestionItem,
18
16
  [CheckoutQuestionType.HOST_TEXTAREA]: HostDefaultCheckoutQuestionItem,
@@ -33,7 +31,6 @@ const CheckoutQuestionsForm = ({ checkoutQuestions, submitButtonDisabled, onSubm
33
31
  return (React.createElement(React.Fragment, null,
34
32
  React.createElement(CheckoutQuestionItemProvider, { checkoutQuestionItems: checkoutQuestionItems },
35
33
  React.createElement(CheckoutQuestions, { checkoutQuestions: filteredCheckoutQuestions })),
36
- React.createElement(View, { style: style.buttonContainer },
37
- React.createElement(Button, { busy: submitButtonDisabled, testID: "checkout-feedback-button", onPress: handlePress }, buttonText))));
34
+ React.createElement(Button, { busy: submitButtonDisabled, testID: "checkout-feedback-button", onPress: handlePress }, buttonText)));
38
35
  };
39
36
  export { CheckoutQuestionsForm };
@@ -1 +1 @@
1
- export declare const VERSION = "6.5.0";
1
+ export declare const VERSION = "6.5.1";
@@ -1 +1 @@
1
- export const VERSION = "6.5.0";
1
+ export const VERSION = "6.5.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -1,15 +1,16 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
3
 
4
- const { space8, space10 } = theme();
4
+ const { space3, space6, space8 } = theme();
5
5
 
6
6
  const style = StyleSheet.create({
7
- bodyColumn: {
8
- paddingBottom: space8,
9
- paddingHorizontal: space8,
10
- },
11
7
  container: {
12
- paddingBottom: space10,
8
+ justifyContent: "flex-start",
9
+ paddingHorizontal: space6,
10
+ paddingVertical: space8,
11
+ },
12
+ containerDesktop: {
13
+ paddingHorizontal: space3,
13
14
  },
14
15
  });
15
16
 
@@ -2,7 +2,7 @@ import React, { FC, useCallback, useEffect, useRef } from "react";
2
2
  import { Spinner } from "@lookiero/aurora";
3
3
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
4
4
  import { useLogger } from "@lookiero/sty-psp-logging";
5
- import { Layout } from "@lookiero/sty-psp-ui";
5
+ import { Layout, useScreenSize } from "@lookiero/sty-psp-ui";
6
6
  import { CheckoutFeedbackProjection } from "../../../../projection/checkoutFeedback/checkoutFeedback";
7
7
  import { CheckoutQuestionType } from "../../../../projection/checkoutQuestion/checkoutQuestion";
8
8
  import { useGiveCheckoutFeedback } from "../../../domain/checkoutFeedback/react/useGiveCheckoutFeedback";
@@ -33,6 +33,8 @@ interface FeedbackProps {
33
33
 
34
34
  const Feedback: FC<FeedbackProps> = ({ layout: Layout }) => {
35
35
  const logger = useLogger();
36
+ const screenSize = useScreenSize();
37
+ const isDesktop = screenSize === "L";
36
38
  const {
37
39
  customer: { customerId, country, segment },
38
40
  } = useStaticInfo();
@@ -114,8 +116,8 @@ const Feedback: FC<FeedbackProps> = ({ layout: Layout }) => {
114
116
 
115
117
  return (
116
118
  <CheckoutQuestionFeedbackProvider feedback={{}} onChanged={handleOnChangedFeedback}>
117
- <Layout style={{ scrollView: style.container }}>
118
- <Body style={{ column: style.bodyColumn }}>
119
+ <Layout>
120
+ <Body style={{ row: [style.container, isDesktop && style.containerDesktop] }}>
119
121
  <CheckoutQuestionsForm
120
122
  checkoutQuestions={checkoutQuestions || []}
121
123
  submitButtonDisabled={giveCheckoutFeedbackStatus === CommandStatus.LOADING}
@@ -1,5 +1,4 @@
1
1
  import React, { FC, useCallback, useMemo } from "react";
2
- import { View } from "react-native";
3
2
  import { Button } from "@lookiero/aurora";
4
3
  import { useI18nMessage } from "@lookiero/i18n-react";
5
4
  import { CheckoutFeedbackProjection } from "../../../../../../projection/checkoutFeedback/checkoutFeedback";
@@ -19,7 +18,6 @@ import { HostSelectCheckoutQuestionItem } from "../../../../components/organisms
19
18
  import { IconCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem";
20
19
  import { TextareaCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem";
21
20
  import { I18nMessages } from "../../../../i18n/i18n";
22
- import { style } from "./CheckoutQuestionsForm.style";
23
21
 
24
22
  const checkoutQuestionItems: CheckoutQuestionItems = {
25
23
  [CheckoutQuestionType.HOST_DEFAULT]: HostDefaultCheckoutQuestionItem,
@@ -61,11 +59,9 @@ const CheckoutQuestionsForm: FC<CheckoutQuestionsFormProps> = ({
61
59
  <CheckoutQuestions checkoutQuestions={filteredCheckoutQuestions} />
62
60
  </CheckoutQuestionItemProvider>
63
61
 
64
- <View style={style.buttonContainer}>
65
- <Button busy={submitButtonDisabled} testID="checkout-feedback-button" onPress={handlePress}>
66
- {buttonText}
67
- </Button>
68
- </View>
62
+ <Button busy={submitButtonDisabled} testID="checkout-feedback-button" onPress={handlePress}>
63
+ {buttonText}
64
+ </Button>
69
65
  </>
70
66
  );
71
67
  };
@@ -1,7 +0,0 @@
1
- declare const style: {
2
- buttonContainer: {
3
- paddingHorizontal: number;
4
- paddingVertical: number;
5
- };
6
- };
7
- export { style };
@@ -1,10 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "@lookiero/sty-psp-ui";
3
- const { space6, space8 } = theme();
4
- const style = StyleSheet.create({
5
- buttonContainer: {
6
- paddingHorizontal: space6,
7
- paddingVertical: space8,
8
- },
9
- });
10
- export { style };
@@ -1,13 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "@lookiero/sty-psp-ui";
3
-
4
- const { space6, space8 } = theme();
5
-
6
- const style = StyleSheet.create({
7
- buttonContainer: {
8
- paddingHorizontal: space6,
9
- paddingVertical: space8,
10
- },
11
- });
12
-
13
- export { style };