@lookiero/checkout 0.5.3 → 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/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 +3 -3
- 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",
|
|
@@ -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",
|
|
@@ -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
|
-
});
|