@lookiero/checkout 0.5.2 → 0.5.4
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 +11 -0
- package/dist/infrastructure/ui/routing/Routing.js +4 -2
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +1 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +6 -1
- package/dist/infrastructure/ui/views/notFound/NotFound.js +3 -1
- package/dist/infrastructure/ui/views/notFound/NotFound.style.js +1 -1
- package/dist/public/images/not-found.png +0 -0
- package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +12 -0
- package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
- package/package.json +9 -9
- package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
- package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +0 -9
package/README.md
CHANGED
|
@@ -26,6 +26,17 @@ Once we can replace the build of Jenkins for NPM one, we are going to be able to
|
|
|
26
26
|
```json
|
|
27
27
|
{
|
|
28
28
|
(...)
|
|
29
|
+
"scripts": {
|
|
30
|
+
(...)
|
|
31
|
+
// Remove
|
|
32
|
+
"build": "tsc -b tsconfig.build.json && cp -R ./src/public/ ./dist/public",
|
|
33
|
+
"build:app": "tsc -p ./tsconfig.build-app.json --noemit && cp -R ./src/public/ ./dist/public && ENTRY_POINT='./src/Expo.tsx' NODE_ENV=production expo export:web --clear",
|
|
34
|
+
// Add
|
|
35
|
+
"build": "tsc -b tsconfig.build.json && npm run copy:assets",
|
|
36
|
+
"build:app": "tsc -p ./tsconfig.build-app.json --noemit && npm run copy:assets && ENTRY_POINT='./src/Expo.tsx' NODE_ENV=production expo export:web --clear",
|
|
37
|
+
"copy:assets": "cp -R ./src/public/ ./dist/public",
|
|
38
|
+
(...)
|
|
39
|
+
},
|
|
29
40
|
"dependencies": {
|
|
30
41
|
(...)
|
|
31
42
|
"@expo/dev-server": "0.1.120",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PaymentsQueryProvider } from "@lookiero/payments-front";
|
|
1
2
|
import React, { lazy, Suspense } from "react";
|
|
2
3
|
import { Navigate, Outlet, useRoutes } from "react-router-native";
|
|
3
4
|
import { Spinner } from "../../../shared/ui/components/atoms/spinner/Spinner";
|
|
@@ -47,8 +48,9 @@ const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthT
|
|
|
47
48
|
{
|
|
48
49
|
path: Routes.CHECKOUT,
|
|
49
50
|
element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
|
|
50
|
-
React.createElement(
|
|
51
|
-
React.createElement(
|
|
51
|
+
React.createElement(PaymentsQueryProvider, null,
|
|
52
|
+
React.createElement(Checkout, { country: customer?.country, customerId: customer?.customerId, useRedirect: useRedirect },
|
|
53
|
+
React.createElement(Outlet, null))))),
|
|
52
54
|
children: [
|
|
53
55
|
{
|
|
54
56
|
path: Routes.CHECKOUT_PAYMENT,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
1
|
+
import { Platform, StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
3
|
const { borderSize, colorGrayscaleL, colorInfo, spaceXS, spaceS, spaceM } = theme();
|
|
4
4
|
const IMAGE_WIDTH = 96;
|
|
@@ -40,6 +40,11 @@ const style = StyleSheet.create({
|
|
|
40
40
|
marginTop: spaceM,
|
|
41
41
|
paddingHorizontal: spaceS,
|
|
42
42
|
paddingVertical: spaceXS,
|
|
43
|
+
...Platform.select({
|
|
44
|
+
web: {
|
|
45
|
+
width: "fit-content",
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
43
48
|
},
|
|
44
49
|
sizeChangeText: {
|
|
45
50
|
textTransform: "uppercase",
|
|
@@ -4,6 +4,7 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
4
4
|
import React, { useCallback } from "react";
|
|
5
5
|
import { Image, Platform } from "react-native";
|
|
6
6
|
import { useNavigate } from "react-router-native";
|
|
7
|
+
import { AspectRatioView } from "../../../../shared/ui/components/atoms/aspectRatioView/AspectRatioView";
|
|
7
8
|
import { Body } from "../../components/layouts/body/Body";
|
|
8
9
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
9
10
|
import { I18nMessages } from "../../i18n/i18n";
|
|
@@ -19,7 +20,8 @@ const NotFound = () => {
|
|
|
19
20
|
const handleOnPress = useCallback(() => navigate(`${basePath}/${Routes.HOME}`), [basePath, navigate]);
|
|
20
21
|
return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { scrollView: style.container } },
|
|
21
22
|
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
22
|
-
React.createElement(
|
|
23
|
+
React.createElement(AspectRatioView, { aspectRatio: 1.25 },
|
|
24
|
+
React.createElement(Image, { resizeMode: "contain", source: require("../../../../public/images/not-found.png"), style: style.image, testID: "not-found-image" })),
|
|
23
25
|
React.createElement(Text, { level: 1, style: style.description, body: true }, descriptionText),
|
|
24
26
|
React.createElement(Button, { onPress: handleOnPress }, buttonText))));
|
|
25
27
|
};
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
declare enum AspectRatioViewResizeDirection {
|
|
3
|
+
VERTICAL = "VERTICAL",
|
|
4
|
+
HORIZONTAL = "HORIZONTAL"
|
|
5
|
+
}
|
|
6
|
+
interface AspectRatioViewProps {
|
|
7
|
+
readonly aspectRatio?: number;
|
|
8
|
+
readonly resizeDirection?: AspectRatioViewResizeDirection;
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const AspectRatioView: FC<AspectRatioViewProps>;
|
|
12
|
+
export { AspectRatioView, AspectRatioViewResizeDirection };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
var AspectRatioViewResizeDirection;
|
|
4
|
+
(function (AspectRatioViewResizeDirection) {
|
|
5
|
+
AspectRatioViewResizeDirection["VERTICAL"] = "VERTICAL";
|
|
6
|
+
AspectRatioViewResizeDirection["HORIZONTAL"] = "HORIZONTAL";
|
|
7
|
+
})(AspectRatioViewResizeDirection || (AspectRatioViewResizeDirection = {}));
|
|
8
|
+
const AspectRatioView = ({ aspectRatio = 1, resizeDirection = AspectRatioViewResizeDirection.HORIZONTAL, children, }) => {
|
|
9
|
+
const [{ width, height }, setDimension] = useState({});
|
|
10
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout } }) => setDimension(resizeDirection === AspectRatioViewResizeDirection.HORIZONTAL
|
|
11
|
+
? { width: layout.width, height: layout.width * aspectRatio }
|
|
12
|
+
: { width: layout.height * aspectRatio, height: layout.height }), [aspectRatio, resizeDirection]);
|
|
13
|
+
return (React.createElement(View, { onLayout: handleOnLayout },
|
|
14
|
+
React.createElement(View, { style: { width, height } }, children)));
|
|
15
|
+
};
|
|
16
|
+
export { AspectRatioView, AspectRatioViewResizeDirection };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"ios": "expo start --ios",
|
|
16
16
|
"web": "expo start --web",
|
|
17
17
|
"export-analyze-web": "BUNDLE_ANALYZE=true NODE_ENV=production expo export:web",
|
|
18
|
-
"build": "tsc -b tsconfig.build.json",
|
|
19
|
-
"build:app": "tsc -p ./tsconfig.build-app.json --noemit && ENTRY_POINT='./src/Expo.tsx' NODE_ENV=production expo export:web --clear",
|
|
18
|
+
"build": "tsc -b tsconfig.build.json && cp -R ./src/public/ ./dist/public",
|
|
19
|
+
"build:app": "tsc -p ./tsconfig.build-app.json --noemit && cp -R ./src/public/ ./dist/public && 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
22
|
"test": "tsc -p ./tsconfig.test.json --noemit && jest",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@lookiero/data-sources": "^0.3",
|
|
47
47
|
"@lookiero/event": "^0.3",
|
|
48
48
|
"@lookiero/locale": "^0.3",
|
|
49
|
-
"@lookiero/payments-front": "^0.16.
|
|
49
|
+
"@lookiero/payments-front": "^0.16.9",
|
|
50
50
|
"apollo-boost": "0.4.4",
|
|
51
51
|
"graphql": "16.6.0",
|
|
52
52
|
"graphql-tag": "2.12.6",
|
|
@@ -67,27 +67,27 @@
|
|
|
67
67
|
"@lookiero/data-sources": "^0.3",
|
|
68
68
|
"@lookiero/event": "^0.3",
|
|
69
69
|
"@lookiero/locale": "^0.3",
|
|
70
|
-
"@lookiero/payments-front": "^0.16.
|
|
70
|
+
"@lookiero/payments-front": "^0.16.9",
|
|
71
71
|
"@pact-foundation/pact": "^10.1.4",
|
|
72
72
|
"@pact-foundation/pact-node": "^10.17.6",
|
|
73
73
|
"@testing-library/react": "^13.4.0",
|
|
74
74
|
"@testing-library/react-hooks": "^8.0.1",
|
|
75
|
-
"@testing-library/react-native": "^11.
|
|
75
|
+
"@testing-library/react-native": "^11.5.0",
|
|
76
76
|
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
|
|
77
77
|
"@types/jest": "^29.2.4",
|
|
78
|
-
"@types/react": "~18.0.
|
|
78
|
+
"@types/react": "~18.0.26",
|
|
79
79
|
"@types/react-dom": "~18.0.0",
|
|
80
80
|
"@types/react-native": "~0.69.1",
|
|
81
81
|
"@types/uuid": "^9.0.0",
|
|
82
82
|
"apollo-boost": "0.4.4",
|
|
83
|
-
"eslint": "^8.
|
|
83
|
+
"eslint": "^8.31.0",
|
|
84
84
|
"eslint-config-prettier": "^8.5.0",
|
|
85
85
|
"eslint-config-react-app": "^7.0.1",
|
|
86
86
|
"eslint-plugin-flowtype": "^8.0.3",
|
|
87
87
|
"eslint-plugin-import": "^2.26.0",
|
|
88
88
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
89
89
|
"eslint-plugin-prettier": "^4.2.1",
|
|
90
|
-
"eslint-plugin-react": "^7.31.
|
|
90
|
+
"eslint-plugin-react": "^7.31.11",
|
|
91
91
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
92
92
|
"eslint-plugin-react-native": "^4.0.0",
|
|
93
93
|
"expo": "~46.0.8",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { removeNotification as sut, REMOVE_NOTIFICATION } from "./removeNotification";
|
|
2
|
-
describe("removeNotification", () => {
|
|
3
|
-
it("returns a RemoveNotification command", () => {
|
|
4
|
-
const aggregateId = "67ac1d5c-6d24-4b19-bc01-8f61c266670c";
|
|
5
|
-
const command = sut({ aggregateId });
|
|
6
|
-
expect(command.aggregateId).toBe(aggregateId);
|
|
7
|
-
expect(command.name).toBe(REMOVE_NOTIFICATION);
|
|
8
|
-
});
|
|
9
|
-
});
|