@lookiero/checkout 2.0.0-beta.0 → 2.0.0-beta.2

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
@@ -38,7 +38,7 @@ Once we can replace the build of Jenkins for NPM one, we are going to be able to
38
38
  "dependencies": {
39
39
  (...)
40
40
  "@expo/dev-server": "0.1.120",
41
- "expo-modules-core": "^1.0.3",
41
+ "expo-modules-core": "^1.2.6",
42
42
  "inline-style-prefixer": "6.0.1",
43
43
  (...)
44
44
  },
@@ -8,7 +8,7 @@ const useStartCheckout = ({ checkoutId, logger }) => {
8
8
  const start = useCallback(async () => {
9
9
  invariant(checkoutId, "CheckoutId must be defined in order to start checkout");
10
10
  try {
11
- return await commandBus(startCheckout({ aggregateId: checkoutId }));
11
+ await commandBus(startCheckout({ aggregateId: checkoutId }));
12
12
  }
13
13
  catch (error) {
14
14
  if (!error?.message?.includes("Checkout is already started")) {
@@ -1,6 +1,6 @@
1
1
  import { ALIGN, Button, Text } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
- import React from "react";
3
+ import React, { useEffect, useRef } from "react";
4
4
  import { useCallback } from "react";
5
5
  import { View } from "react-native";
6
6
  import { Modal } from "../../../../../ui/components/layouts/modal/Modal";
@@ -9,7 +9,19 @@ const ModalNotificationItem = ({ visible, notification, onRemove, testID = "moda
9
9
  const titleText = useI18nMessage({ id: notification.titleI18nKey });
10
10
  const bodyText = useI18nMessage({ id: notification.bodyI18nKey });
11
11
  const acceptText = useI18nMessage({ id: notification.acceptI18nKey });
12
- const handleOnClose = useCallback(() => onRemove(notification.id), [notification.id, onRemove]);
12
+ const modalNotificationClosedRef = useRef(false);
13
+ const handleOnClose = useCallback(() => {
14
+ onRemove(notification.id);
15
+ modalNotificationClosedRef.current = true;
16
+ }, [notification.id, onRemove]);
17
+ /**
18
+ * Remove modal notification when this view is unmounted
19
+ */
20
+ useEffect(() => () => {
21
+ if (!modalNotificationClosedRef.current) {
22
+ onRemove(notification.id);
23
+ }
24
+ }, [notification.id, onRemove]);
13
25
  return (React.createElement(Modal, { testID: testID, visible: visible, onClose: handleOnClose },
14
26
  React.createElement(View, { style: style.modal },
15
27
  React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "build:app": "tsc -p ./tsconfig.build-app.json --noemit && ENTRY_POINT='./src/Expo.tsx' NODE_ENV=production expo export:web --clear",
20
20
  "lint": "eslint --fix --cache --cache-location ./node_modules/.cache/.eslintcache --ext ts,tsx .",
21
21
  "format": "prettier --write \"**/*.+(json|css|ts|tsx|md)\"",
22
- "test": "tsc -p ./tsconfig.test.json --noemit && jest",
22
+ "test": "tsc -p ./tsconfig.test.json --noemit && jest --passWithNoTests --colors --verbose --runInBand --detectOpenHandles --forceExit",
23
23
  "test:coverage": "jest --coverage --coverageReporters=text --detectOpenHandles --forceExit --silent",
24
24
  "test:contract": "TEST_ENV=CONTRACT jest --coverage false --detectOpenHandles --testMatch \"**/?(*.)+(pact).ts\" --testTimeout=3000 --watchAll=false --forceExit",
25
25
  "publish:contract": "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) node pact.publish.js",
@@ -37,15 +37,15 @@
37
37
  "inline-style-prefixer": "6.0.1",
38
38
  "lodash": "^4.17.21",
39
39
  "react-native-keyboard-aware-scroll-view": "^0.9.5",
40
- "react-native-safe-area-context": "^4.4.1",
41
- "react-native-svg": "^12.1.1",
40
+ "react-native-safe-area-context": "^4.5.0",
41
+ "react-native-svg": "^13.4.0",
42
42
  "tiny-invariant": "^1.3.1",
43
43
  "uuid": "^9.0.0"
44
44
  },
45
45
  "peerDependencies": {
46
+ "@lookiero/aurora": "^3.1.0",
46
47
  "@lookiero/aurora-fonts": "^1.0.6",
47
48
  "@lookiero/aurora-iconfont": "^2.0.41",
48
- "@lookiero/aurora": "^3.1.0",
49
49
  "@lookiero/data-sources": "^0.3",
50
50
  "@lookiero/event": "^0.3",
51
51
  "@lookiero/locale": "^0.3",
@@ -54,20 +54,20 @@
54
54
  "apollo-boost": "0.4.4",
55
55
  "graphql": "16.6.0",
56
56
  "graphql-tag": "2.12.6",
57
- "react": "^18.0.0",
58
- "react-dom": "^18.0.0",
59
- "react-native": "^0.70.6",
57
+ "react": "^18.2.0",
58
+ "react-dom": "^18.2.0",
59
+ "react-native": "^0.71.4",
60
60
  "react-native-get-random-values": "^1.8.0",
61
- "react-native-web": "^0.18.9",
61
+ "react-native-web": "^0.18.11",
62
62
  "react-router-dom": "^6.8.1",
63
63
  "react-router-native": "^6.8.1"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/core": "^7.19.1",
67
- "@expo/webpack-config": "^0.17.2",
66
+ "@babel/core": "^7.20.0",
67
+ "@expo/webpack-config": "^0.17.4",
68
+ "@lookiero/aurora": "^3.1.0",
68
69
  "@lookiero/aurora-fonts": "^1.0.6",
69
70
  "@lookiero/aurora-iconfont": "^2.0.41",
70
- "@lookiero/aurora": "^3.1.0",
71
71
  "@lookiero/data-sources": "^0.3",
72
72
  "@lookiero/event": "^0.3",
73
73
  "@lookiero/locale": "^0.3",
@@ -77,14 +77,12 @@
77
77
  "@pact-foundation/pact-node": "^10.17.6",
78
78
  "@react-native-firebase/analytics": "10.5.1",
79
79
  "@react-native-firebase/app": "10.5.0",
80
- "@testing-library/react": "^13.4.0",
81
- "@testing-library/react-hooks": "^8.0.1",
82
80
  "@testing-library/react-native": "^11.5.0",
83
81
  "@trivago/prettier-plugin-sort-imports": "^3.3.0",
84
82
  "@types/jest": "^29.2.4",
85
- "@types/react": "~18.0.26",
86
- "@types/react-dom": "~18.0.0",
87
- "@types/react-native": "~0.69.1",
83
+ "@types/react": "~18.0.27",
84
+ "@types/react-dom": "~18.0.10",
85
+ "@types/react-native": "^0.70.13",
88
86
  "@types/uuid": "^9.0.0",
89
87
  "abort-controller": "^3.0.0",
90
88
  "apollo-boost": "0.4.4",
@@ -98,31 +96,30 @@
98
96
  "eslint-plugin-react": "^7.31.11",
99
97
  "eslint-plugin-react-hooks": "^4.6.0",
100
98
  "eslint-plugin-react-native": "^4.0.0",
101
- "expo": "~46.0.8",
102
- "expo-modules-core": "^1.0.3",
103
- "expo-status-bar": "~1.4.0",
99
+ "expo": "^48.0.0",
100
+ "expo-modules-core": "^1.2.6",
101
+ "expo-status-bar": "~1.4.4",
104
102
  "graphql": "16.6.0",
105
103
  "graphql-tag": "2.12.6",
106
104
  "husky": "^8.0.2",
107
105
  "jest": "^29.3.1",
108
- "jest-expo": "^46.0.1",
106
+ "jest-expo": "^48.0.0",
109
107
  "jest-fetch-mock": "^3.0.3",
110
108
  "jest-mock-extended": "^3.0.1",
111
109
  "lint-staged": "^13.0.3",
112
110
  "pino-std-serializers": "^6.0.0",
113
111
  "prettier": "^2.7.1",
114
- "react": "^18.0.0",
115
- "react-dom": "^18.0.0",
112
+ "react": "^18.2.0",
113
+ "react-dom": "^18.2.0",
116
114
  "react-error-overlay": "^6.0.9",
117
- "react-native": "^0.70.6",
115
+ "react-native": "^0.71.3",
118
116
  "react-native-adjust": "^4.33.0",
119
117
  "react-native-get-random-values": "^1.8.0",
120
- "react-native-unimodules": "^0.14.10",
121
- "react-native-web": "^0.18.9",
118
+ "react-native-web": "^0.18.11",
122
119
  "react-router-dom": "^6.8.1",
123
120
  "react-router-native": "^6.8.1",
124
121
  "react-test-renderer": "^18.0.0",
125
- "typescript": "^4.9.3",
122
+ "typescript": "^4.9.4",
126
123
  "webpack-bundle-analyzer": "^4.7.0"
127
124
  }
128
125
  }