@blocklet/discuss-kit-ux 2.4.55 → 2.4.56
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,11 +1,10 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { Box,
|
|
2
|
+
import { useNavigate } from "react-router-dom";
|
|
3
|
+
import { Box, styled } from "@mui/material";
|
|
4
4
|
import Tooltip, { tooltipClasses } from "@mui/material/Tooltip";
|
|
5
5
|
import DID from "@arcblock/ux/lib/DID";
|
|
6
|
-
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
7
6
|
import { green } from "@mui/material/colors";
|
|
8
|
-
import {
|
|
7
|
+
import { SocialActions } from "@arcblock/ux/lib/UserCard";
|
|
9
8
|
import { useBrowser } from "@arcblock/react-hooks";
|
|
10
9
|
import { useState } from "react";
|
|
11
10
|
import Avatar from "../avatars/avatar.mjs";
|
|
@@ -15,11 +14,7 @@ import { useChatInWallet } from "../chat/hooks.mjs";
|
|
|
15
14
|
import { openProfile, isInDiscussKitApp } from "../utils.mjs";
|
|
16
15
|
export function ProfileCard({ user, click, ...rest }) {
|
|
17
16
|
const { session } = useSessionContext();
|
|
18
|
-
const
|
|
19
|
-
let chatUrl = user?.did && `/chat/dm/${user?.did}`;
|
|
20
|
-
if (chatUrl && window.location.pathname?.includes(user?.did)) {
|
|
21
|
-
chatUrl = "";
|
|
22
|
-
}
|
|
17
|
+
const isLogin = !!session?.user?.did;
|
|
23
18
|
return /* @__PURE__ */ jsxs(
|
|
24
19
|
Box,
|
|
25
20
|
{
|
|
@@ -82,20 +77,9 @@ export function ProfileCard({ user, click, ...rest }) {
|
|
|
82
77
|
/* @__PURE__ */ jsx(Box, { sx: { mt: 1 }, children: /* @__PURE__ */ jsx(Badge, { passports: user?.passports || [], pointInfo: user?.pointInfo || {}, did: user?.did }) })
|
|
83
78
|
] })
|
|
84
79
|
] }),
|
|
85
|
-
|
|
80
|
+
(!isLogin || user?.did !== window.blocklet.appId && session?.user?.did && session?.user?.did !== user.did) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
86
81
|
/* @__PURE__ */ jsx(Box, { sx: { my: 2, borderTop: "1px solid", borderColor: "divider" } }),
|
|
87
|
-
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
88
|
-
Button,
|
|
89
|
-
{
|
|
90
|
-
component: Link,
|
|
91
|
-
to: chatUrl,
|
|
92
|
-
variant: "outlined",
|
|
93
|
-
color: "inherit",
|
|
94
|
-
startIcon: /* @__PURE__ */ jsx(ChatBubbleOutlineOutlinedIcon, { style: { fontSize: 16 } }),
|
|
95
|
-
sx: { fontSize: 12 },
|
|
96
|
-
children: t("messages")
|
|
97
|
-
}
|
|
98
|
-
) })
|
|
82
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(SocialActions, { session, showSocialActions: true, user }) })
|
|
99
83
|
] })
|
|
100
84
|
]
|
|
101
85
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.56",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@arcblock/bridge": "^3.1.
|
|
19
|
-
"@arcblock/react-hooks": "^3.1.
|
|
20
|
-
"@arcblock/ws": "^1.
|
|
21
|
-
"@blocklet/js-sdk": "^1.16.
|
|
18
|
+
"@arcblock/bridge": "^3.1.30",
|
|
19
|
+
"@arcblock/react-hooks": "^3.1.30",
|
|
20
|
+
"@arcblock/ws": "^1.23.1",
|
|
21
|
+
"@blocklet/js-sdk": "^1.16.49-beta-20250827-025603-2bb1a7ee",
|
|
22
22
|
"@blocklet/uploader": "^0.2.7",
|
|
23
23
|
"@emotion/css": "^11.13.5",
|
|
24
24
|
"@emotion/react": "^11.14.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"unstated-next": "^1.1.0",
|
|
48
48
|
"url-join": "^4.0.1",
|
|
49
49
|
"zustand": "^4.5.5",
|
|
50
|
-
"@blocklet/editor": "2.4.
|
|
51
|
-
"@blocklet/labels": "2.4.
|
|
50
|
+
"@blocklet/editor": "2.4.56",
|
|
51
|
+
"@blocklet/labels": "2.4.56"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@arcblock/did-connect-react": "^3.1.5",
|