@lookiero/checkout 2.1.0 → 2.2.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.
package/README.md CHANGED
@@ -45,6 +45,7 @@ Once we can replace the build of Jenkins for NPM one, we are going to be able to
45
45
  "devDependencies": {
46
46
  (...)
47
47
  "pino-std-serializers": "^6.0.0",
48
+ "@types/pino-pretty": "^5.0.0",
48
49
  (...)
49
50
  }
50
51
  }
@@ -1,10 +1,10 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../../theme/theme";
3
- const { spaceL, spaceXXXL } = theme();
3
+ const { spaceS, spaceM } = theme();
4
4
  const style = StyleSheet.create({
5
5
  title: {
6
- marginBottom: spaceL,
7
- marginTop: spaceXXXL,
6
+ marginBottom: spaceM,
7
+ marginTop: spaceS,
8
8
  textAlign: "center",
9
9
  },
10
10
  });
@@ -1,7 +1,7 @@
1
1
  declare const containerUnderlayColor: string;
2
2
  declare const style: {
3
3
  container: {
4
- marginVertical: number;
4
+ marginBottom: number;
5
5
  };
6
6
  modalContent: {
7
7
  paddingBottom: number;
@@ -1,13 +1,13 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../../theme/theme";
3
- const { spaceM, spaceXL, colorGrayscaleS } = theme();
3
+ const { spaceM, spaceL, spaceXL, colorGrayscaleS } = theme();
4
4
  const containerUnderlayColor = colorGrayscaleS;
5
5
  const style = StyleSheet.create({
6
6
  container: {
7
- marginVertical: spaceM,
7
+ marginBottom: spaceM,
8
8
  },
9
9
  modalContent: {
10
- paddingBottom: spaceXL,
10
+ paddingBottom: spaceL,
11
11
  paddingHorizontal: spaceXL,
12
12
  },
13
13
  });
@@ -5,7 +5,7 @@ declare const style: {
5
5
  marginVertical: number;
6
6
  };
7
7
  title: {
8
- marginVertical: number;
8
+ marginBottom: number;
9
9
  textAlign: "center";
10
10
  };
11
11
  };
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../../theme/theme";
3
- const { colorGrayscaleL, spaceM, spaceL } = theme();
3
+ const { colorGrayscaleL, spaceM } = theme();
4
4
  const style = StyleSheet.create({
5
5
  feedback: {
6
6
  color: colorGrayscaleL,
@@ -8,7 +8,7 @@ const style = StyleSheet.create({
8
8
  marginVertical: spaceM,
9
9
  },
10
10
  title: {
11
- marginVertical: spaceL,
11
+ marginBottom: spaceM,
12
12
  textAlign: "center",
13
13
  },
14
14
  });
@@ -104,6 +104,6 @@ const Item = ({ customerId, country }) => {
104
104
  }
105
105
  return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: checkoutItem.feedbacks || {} },
106
106
  checkoutItem.status === CheckoutItemStatus.INITIAL ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, onReturn: showReturnQuestions })) : (React.createElement(ItemWithCustomerDecission, { checkoutId: checkout.id, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, returnQuestions: returnQuestions, onEditFeedback: showReturnQuestions })),
107
- React.createElement(ReturnQuestionsForm, { checkoutItemPrice: checkoutItem.price, country: country, productVariant: checkoutItem.productVariant, returnQuestions: returnQuestions, visible: returnQuestionsVisible, onClose: hideReturnQuestions, onSubmit: returnItem })));
107
+ React.createElement(ReturnQuestionsForm, { returnQuestions: returnQuestions, visible: returnQuestionsVisible, onClose: hideReturnQuestions, onSubmit: returnItem })));
108
108
  };
109
109
  export { Item };
@@ -1,15 +1,9 @@
1
1
  import { FC } from "react";
2
- import { CheckoutItemProductVariantProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
3
2
  import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
4
3
  import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
5
- import { Country } from "../../../../../../projection/shared/country";
6
- import { PriceProjection } from "../../../../../../projection/shared/price";
7
4
  interface ReturnQuestionsFormProps {
8
5
  readonly visible: boolean;
9
6
  readonly returnQuestions: ReturnQuestionProjection[];
10
- readonly checkoutItemPrice: PriceProjection;
11
- readonly productVariant: CheckoutItemProductVariantProjection;
12
- readonly country: Country;
13
7
  readonly onSubmit: (feedback: FeedbackProjection) => void;
14
8
  readonly onClose: () => void;
15
9
  }
@@ -14,7 +14,6 @@ import { HostStackReturnQuestionItem } from "../../../../components/organisms/re
14
14
  import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
15
15
  import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
16
16
  import { I18nMessages } from "../../../../i18n/i18n";
17
- import { ProductVariant } from "../../../shared/components/productVariant/ProductVariant";
18
17
  import { style } from "./ReturnQuestionsForm.style";
19
18
  const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
20
19
  const returnQuestionItems = {
@@ -25,10 +24,9 @@ const returnQuestionItems = {
25
24
  [ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
26
25
  [ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
27
26
  };
28
- const ReturnQuestionsForm = ({ returnQuestions, checkoutItemPrice, productVariant, visible, country, onSubmit, onClose, }) => {
27
+ const ReturnQuestionsForm = ({ returnQuestions, visible, onSubmit, onClose }) => {
29
28
  const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
30
29
  const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
31
- const { media, brand, name, size, color } = productVariant;
32
30
  const feedback = useReturnQuestionFeedback();
33
31
  const handleOnSubmit = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
34
32
  return (React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
@@ -36,7 +34,6 @@ const ReturnQuestionsForm = ({ returnQuestions, checkoutItemPrice, productVarian
36
34
  React.createElement(Modal, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, testID: "return-questions-form-modal", visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
37
35
  React.createElement(View, { style: style.returnQuestionsContainer },
38
36
  React.createElement(Text, { level: 2, style: style.title }, titleText),
39
- React.createElement(ProductVariant, { brand: brand, color: color, country: country, media: media, name: name, price: checkoutItemPrice, size: size }),
40
37
  React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
41
38
  React.createElement(Button, { style: style.submit, onPress: handleOnSubmit }, submitButtonText)))));
42
39
  };
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../theme/theme";
3
- const { spaceXL } = theme();
3
+ const { spaceS, spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
5
  returnQuestionsContainer: {
6
6
  paddingHorizontal: spaceXL,
@@ -9,7 +9,7 @@ const style = StyleSheet.create({
9
9
  marginTop: spaceXL,
10
10
  },
11
11
  title: {
12
- marginBottom: spaceXL,
12
+ marginBottom: spaceS,
13
13
  textAlign: "center",
14
14
  },
15
15
  });
@@ -77,7 +77,9 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
77
77
  showCloseButton && (React.createElement(ButtonIcon, { name: "close", style: { button: customStyle?.closeButton }, onPress: onClose })))),
78
78
  React.createElement(ModalContentView, null,
79
79
  React.createElement(View, { style: {
80
- paddingBottom: safeAreaInsetBottom + (Platform.OS === "web" ? spaceXL : footerHeight),
80
+ paddingBottom: safeAreaInsetBottom +
81
+ (Platform.OS !== "ios" ? spaceXL : 0) +
82
+ (Platform.OS !== "web" ? footerHeight : 0),
81
83
  } }, children)),
82
84
  footer && (React.createElement(Sticky, { style: style.stickyFooter, onLayout: handleOnFooterLayout }, footer))))))))));
83
85
  };
@@ -3,11 +3,11 @@ import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
3
  const { borderSize, colorGrayscaleS, spaceM, spaceL, spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
5
  modalContent: {
6
- paddingBottom: spaceXL,
6
+ paddingBottom: spaceL,
7
7
  paddingHorizontal: spaceXL,
8
8
  },
9
9
  modalTitle: {
10
- marginBottom: spaceL,
10
+ marginBottom: spaceM,
11
11
  textAlign: "center",
12
12
  },
13
13
  option: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -80,6 +80,7 @@
80
80
  "@testing-library/react-native": "^11.5.0",
81
81
  "@trivago/prettier-plugin-sort-imports": "^3.3.0",
82
82
  "@types/jest": "^29.2.4",
83
+ "@types/pino-pretty": "^5.0.0",
83
84
  "@types/react": "~18.0.27",
84
85
  "@types/react-dom": "~18.0.10",
85
86
  "@types/react-native": "^0.70.13",