ag-common 0.0.198 → 0.0.201
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { User } from '../../helpers/jwt';
|
|
3
3
|
export declare const UserImageIcon: JSX.Element;
|
|
4
4
|
export declare const UserImage: ({ image, className, }: {
|
|
5
5
|
image?: string | undefined;
|
|
@@ -7,5 +7,5 @@ export declare const UserImage: ({ image, className, }: {
|
|
|
7
7
|
}) => JSX.Element;
|
|
8
8
|
export declare const UserProfileImage: ({ className, user, }: {
|
|
9
9
|
className?: string | undefined;
|
|
10
|
-
user
|
|
10
|
+
user?: User | undefined;
|
|
11
11
|
}) => JSX.Element;
|
|
@@ -57,14 +57,13 @@ const UserImage = ({ image, className, }) => {
|
|
|
57
57
|
};
|
|
58
58
|
exports.UserImage = UserImage;
|
|
59
59
|
const UserProfileImage = ({ className, user, }) => {
|
|
60
|
-
|
|
61
|
-
const image = (_a = user === null || user === void 0 ? void 0 : user.data) === null || _a === void 0 ? void 0 : _a.picture;
|
|
60
|
+
const image = user === null || user === void 0 ? void 0 : user.picture;
|
|
62
61
|
if (image) {
|
|
63
62
|
if (!images.domains.find((i) => image.includes(i))) {
|
|
64
63
|
(0, log_1.warn)(`bad domain:${image}`);
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
|
-
const titleA = [
|
|
66
|
+
const titleA = [user === null || user === void 0 ? void 0 : user.fullname, user === null || user === void 0 ? void 0 : user.userId].filter(array_1.notEmpty);
|
|
68
67
|
const title = titleA.length === 0 ? '' : titleA.join(' - ');
|
|
69
68
|
return (react_1.default.createElement(Base, { className: className, title: title },
|
|
70
69
|
image && react_1.default.createElement(Img, { alt: "user", src: image }),
|
package/dist/ui/helpers/jwt.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export interface AuthedUserContext {
|
|
|
69
69
|
*/
|
|
70
70
|
loginWithRedirect: (stateqs?: string) => Promise<void>;
|
|
71
71
|
logout: () => Promise<void>;
|
|
72
|
-
user
|
|
72
|
+
user?: User;
|
|
73
73
|
error: Error | undefined;
|
|
74
74
|
refreshToken: () => Promise<User | undefined>;
|
|
75
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ag-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.201",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"author": "Andrei Gec <@andreigec> (https://gec.dev/)",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"aws-cdk-lib": "2.x",
|
|
18
|
-
"aws-sdk": "2.
|
|
18
|
+
"aws-sdk": "2.x",
|
|
19
19
|
"axios": "0.26.1",
|
|
20
20
|
"constructs": "10.x",
|
|
21
21
|
"jsonwebtoken": "8.5.1",
|
|
22
22
|
"jwks-rsa": "2.0.5",
|
|
23
23
|
"node-cache": "5.1.2",
|
|
24
24
|
"openapi-request-validator": "10.0.0",
|
|
25
|
-
"react": "
|
|
26
|
-
"react-dom": "
|
|
25
|
+
"react": "18.0.0",
|
|
26
|
+
"react-dom": "18.0.0",
|
|
27
27
|
"react-hot-toast": "2.2.0",
|
|
28
28
|
"styled-components": "5.3.5",
|
|
29
29
|
"typescript": "4.6.3"
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@types/react": "17.0.43",
|
|
35
35
|
"@types/react-dom": "17.0.14",
|
|
36
36
|
"@types/styled-components": "5.1.24",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
38
|
-
"@typescript-eslint/parser": "5.
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "5.17.0",
|
|
38
|
+
"@typescript-eslint/parser": "5.17.0",
|
|
39
39
|
"eslint": "8.12.0",
|
|
40
40
|
"eslint-config-airbnb-typescript": "16.1.4",
|
|
41
41
|
"eslint-config-prettier": "8.5.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
45
45
|
"eslint-plugin-prettier": "4.0.0",
|
|
46
46
|
"eslint-plugin-react": "7.29.4",
|
|
47
|
-
"eslint-plugin-react-hooks": "4.
|
|
47
|
+
"eslint-plugin-react-hooks": "4.4.0",
|
|
48
48
|
"prettier": "2.6.1",
|
|
49
49
|
"rimraf": "3.0.2",
|
|
50
50
|
"typescript-styled-plugin": "0.18.2"
|