@arcblock/ux 3.1.32 → 3.1.33
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/lib/UserCard/Cards/social-actions.js +13 -11
- package/lib/UserCard/Content/minimal.js +48 -45
- package/lib/Util/index.js +39 -37
- package/lib/package.json.js +1 -1
- package/package.json +7 -7
- package/src/UserCard/Cards/social-actions.tsx +5 -3
- package/src/UserCard/Content/minimal.tsx +10 -5
- package/src/Util/index.ts +4 -0
@@ -2,12 +2,12 @@ import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as r } from "react";
|
3
3
|
import { styled as C, Button as F, Box as M } from "@mui/material";
|
4
4
|
import { useMemoizedFn as u } from "ahooks";
|
5
|
-
import { joinURL as
|
5
|
+
import { joinURL as z } from "ufo";
|
6
6
|
import w from "lodash/noop";
|
7
|
-
import { Icon as
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
7
|
+
import { Icon as N } from "@iconify/react";
|
8
|
+
import U from "@mui/icons-material/Notifications";
|
9
|
+
import k from "@mui/icons-material/NotificationsOff";
|
10
|
+
import v from "../use-follow.js";
|
11
11
|
import { useLocaleContext as h } from "../../Locale/context.js";
|
12
12
|
import { translate as g } from "../../Locale/util.js";
|
13
13
|
import { isSupportFollow as L } from "../../Util/index.js";
|
@@ -43,17 +43,18 @@ function j({
|
|
43
43
|
});
|
44
44
|
return;
|
45
45
|
}
|
46
|
-
window.open(
|
46
|
+
window.open(z(l, `/chat/dm/${o?.did}`), "_blank");
|
47
47
|
});
|
48
48
|
return r(() => (typeof t == "boolean" ? !!t : t?.chat) && !!l, [t, l]) ? /* @__PURE__ */ m(
|
49
49
|
x,
|
50
50
|
{
|
51
51
|
className: "user-card__social-actions-chat",
|
52
52
|
variant: "outlined",
|
53
|
-
color: "
|
53
|
+
color: "primary",
|
54
|
+
size: "small",
|
54
55
|
onClick: c,
|
55
56
|
children: [
|
56
|
-
/* @__PURE__ */ s(
|
57
|
+
/* @__PURE__ */ s(N, { icon: "tabler:message-dots", style: { marginRight: 4 } }),
|
57
58
|
e("chat")
|
58
59
|
]
|
59
60
|
}
|
@@ -64,7 +65,7 @@ function B({
|
|
64
65
|
showSocialActions: t,
|
65
66
|
session: n
|
66
67
|
}) {
|
67
|
-
const { locale: i } = h() || { locale: "en" }, e = u((
|
68
|
+
const { locale: i } = h() || { locale: "en" }, e = u((y, b = {}) => g(_, y, i, "en", b)), d = r(() => !!n?.user?.did, [n?.user?.did]), l = r(() => typeof t == "boolean" ? !!t : t?.follow, [t]), { followed: c, followUser: p, unfollowUser: a } = v({
|
68
69
|
user: o,
|
69
70
|
t: e,
|
70
71
|
isMySelf: !1,
|
@@ -84,10 +85,11 @@ function B({
|
|
84
85
|
{
|
85
86
|
className: "user-card__social-actions-follow",
|
86
87
|
variant: "outlined",
|
87
|
-
color: "
|
88
|
+
color: "primary",
|
89
|
+
size: "small",
|
88
90
|
onClick: f,
|
89
91
|
children: [
|
90
|
-
c ? /* @__PURE__ */ s(
|
92
|
+
c ? /* @__PURE__ */ s(k, { sx: { fontSize: 14, mr: 0.5 } }) : /* @__PURE__ */ s(U, { sx: { fontSize: 14, mr: 0.5 } }),
|
91
93
|
e(c ? "unfollow" : "follow")
|
92
94
|
]
|
93
95
|
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import { Box as
|
4
|
-
import { DID as
|
5
|
-
import
|
6
|
-
import { renderTopRight as
|
7
|
-
import
|
8
|
-
import
|
9
|
-
function
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { memo as g } from "react";
|
3
|
+
import { useMediaQuery as y, Box as o, Typography as w, Divider as C } from "@mui/material";
|
4
|
+
import { DID as S } from "../../DID/index.js";
|
5
|
+
import b from "./tooltip-avatar.js";
|
6
|
+
import { renderTopRight as v } from "../components.js";
|
7
|
+
import W from "./shorten-label.js";
|
8
|
+
import j from "../Cards/social-actions.js";
|
9
|
+
function D({ ...s }) {
|
10
10
|
const {
|
11
11
|
user: e,
|
12
|
-
showDid:
|
13
|
-
didProps:
|
14
|
-
avatarSize:
|
15
|
-
shouldShowHoverCard:
|
16
|
-
renderCardContent:
|
17
|
-
renderTopRightContent:
|
18
|
-
topRightMaxWidth:
|
19
|
-
avatarProps:
|
20
|
-
shortenLabelProps:
|
21
|
-
renderName:
|
22
|
-
...
|
23
|
-
} =
|
24
|
-
return /* @__PURE__ */
|
25
|
-
|
12
|
+
showDid: d,
|
13
|
+
didProps: m,
|
14
|
+
avatarSize: c,
|
15
|
+
shouldShowHoverCard: p,
|
16
|
+
renderCardContent: f,
|
17
|
+
renderTopRightContent: a,
|
18
|
+
topRightMaxWidth: h,
|
19
|
+
avatarProps: x,
|
20
|
+
shortenLabelProps: u,
|
21
|
+
renderName: l,
|
22
|
+
...n
|
23
|
+
} = s, r = y("(max-width:500px)");
|
24
|
+
return /* @__PURE__ */ i(
|
25
|
+
o,
|
26
26
|
{
|
27
27
|
className: "user-card__avatar-content",
|
28
28
|
sx: {
|
@@ -31,33 +31,35 @@ function w({ ...a }) {
|
|
31
31
|
alignItems: "center"
|
32
32
|
},
|
33
33
|
children: [
|
34
|
-
/* @__PURE__ */
|
35
|
-
|
34
|
+
/* @__PURE__ */ i(
|
35
|
+
o,
|
36
36
|
{
|
37
37
|
sx: {
|
38
38
|
display: "flex",
|
39
39
|
justifyContent: "space-between",
|
40
|
-
|
41
|
-
|
40
|
+
flexDirection: r ? "column" : "row",
|
41
|
+
alignItems: r ? "flex-start" : "center",
|
42
|
+
gap: r ? 2 : 1,
|
42
43
|
flex: 1,
|
43
|
-
minWidth: 0
|
44
|
+
minWidth: 0,
|
45
|
+
flexWrap: "wrap"
|
44
46
|
},
|
45
47
|
children: [
|
46
|
-
/* @__PURE__ */ o
|
48
|
+
/* @__PURE__ */ i(o, { sx: { display: "flex", justifyContent: "flex-start", alignItems: "center", gap: 1, flex: 1 }, children: [
|
47
49
|
/* @__PURE__ */ t(
|
48
|
-
|
50
|
+
b,
|
49
51
|
{
|
50
52
|
user: e,
|
51
|
-
avatarSize:
|
52
|
-
shouldShowHoverCard:
|
53
|
-
renderCardContent:
|
54
|
-
avatarProps:
|
55
|
-
...
|
53
|
+
avatarSize: c,
|
54
|
+
shouldShowHoverCard: p,
|
55
|
+
renderCardContent: f,
|
56
|
+
avatarProps: x,
|
57
|
+
...n
|
56
58
|
}
|
57
59
|
),
|
58
|
-
/* @__PURE__ */ o
|
60
|
+
/* @__PURE__ */ i(o, { children: [
|
59
61
|
/* @__PURE__ */ t(
|
60
|
-
|
62
|
+
w,
|
61
63
|
{
|
62
64
|
variant: "subtitle1",
|
63
65
|
className: "user-card__full-name-label",
|
@@ -68,11 +70,11 @@ function w({ ...a }) {
|
|
68
70
|
fontSize: 18,
|
69
71
|
lineHeight: 1.1
|
70
72
|
},
|
71
|
-
children:
|
73
|
+
children: l ? l(e) : /* @__PURE__ */ t(W, { sx: { fontWeight: 500 }, ...u, children: e.fullName || e.email || e.did })
|
72
74
|
}
|
73
75
|
),
|
74
|
-
|
75
|
-
|
76
|
+
d && e.did ? /* @__PURE__ */ t(
|
77
|
+
S,
|
76
78
|
{
|
77
79
|
did: e.did,
|
78
80
|
size: 14,
|
@@ -80,21 +82,22 @@ function w({ ...a }) {
|
|
80
82
|
compact: !0,
|
81
83
|
locale: "en",
|
82
84
|
sx: { lineHeight: 1.5 },
|
83
|
-
...
|
85
|
+
...m ?? {}
|
84
86
|
}
|
85
87
|
) : null
|
86
88
|
] })
|
87
89
|
] }),
|
88
|
-
/* @__PURE__ */ t(
|
90
|
+
r ? /* @__PURE__ */ t(C, { sx: { width: "100%" } }) : null,
|
91
|
+
a ? null : /* @__PURE__ */ t(j, { showSocialActions: n.showSocialActions, user: e, session: n.session })
|
89
92
|
]
|
90
93
|
}
|
91
94
|
),
|
92
|
-
|
95
|
+
v(a, h)
|
93
96
|
]
|
94
97
|
}
|
95
98
|
);
|
96
99
|
}
|
97
|
-
const
|
100
|
+
const P = g(D);
|
98
101
|
export {
|
99
|
-
|
102
|
+
P as default
|
100
103
|
};
|
package/lib/Util/index.js
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
import { lazy as j } from "react";
|
2
|
-
import
|
2
|
+
import l from "lodash/padStart";
|
3
3
|
import { colors as w, getDIDMotifInfo as x } from "@arcblock/did-motif";
|
4
4
|
import { mergeAllThemeOptions as Ke } from "@blocklet/theme";
|
5
5
|
import I from "lodash/isNil";
|
6
6
|
import E from "lodash/omitBy";
|
7
|
-
import
|
7
|
+
import v from "p-retry";
|
8
8
|
import m from "js-cookie";
|
9
|
-
import
|
9
|
+
import O from "color-convert";
|
10
10
|
import a from "dayjs";
|
11
11
|
import "dayjs/locale/zh-cn";
|
12
|
-
import
|
13
|
-
import
|
12
|
+
import U from "dayjs/plugin/utc";
|
13
|
+
import F from "dayjs/plugin/timezone";
|
14
14
|
import A from "dayjs/plugin/relativeTime";
|
15
15
|
import P from "dayjs/plugin/updateLocale";
|
16
16
|
import R from "dayjs/plugin/localizedFormat";
|
@@ -18,15 +18,15 @@ import W from "semver";
|
|
18
18
|
import { DID_PREFIX as L, BLOCKLET_SERVICE_PATH_PREFIX as C } from "./constant.js";
|
19
19
|
import b from "../package.json.js";
|
20
20
|
import { getFederatedEnabled as M } from "./federated.js";
|
21
|
-
let
|
22
|
-
const _ = /^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/, z = /* @__PURE__ */ new Set(["co", "com", "net", "org", "gov", "edu", "ac"]),
|
23
|
-
function
|
21
|
+
let u = null;
|
22
|
+
const _ = /^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/, z = /* @__PURE__ */ new Set(["co", "com", "net", "org", "gov", "edu", "ac"]), N = /* @__PURE__ */ new Set(["uk", "au", "cn", "nz", "za", "in", "br", "mx", "fr", "it", "ca"]);
|
23
|
+
function B(e) {
|
24
24
|
if (!e)
|
25
25
|
return !1;
|
26
26
|
const t = e.split(".");
|
27
27
|
if (t.length < 2) return !1;
|
28
28
|
const o = t[t.length - 2], n = t[t.length - 1];
|
29
|
-
return z.has(o) &&
|
29
|
+
return z.has(o) && N.has(n);
|
30
30
|
}
|
31
31
|
function ye() {
|
32
32
|
const { host: e } = window.location;
|
@@ -37,7 +37,7 @@ function ye() {
|
|
37
37
|
return "";
|
38
38
|
if (o.length > 2) {
|
39
39
|
const n = o.slice(-2).join(".");
|
40
|
-
if (
|
40
|
+
if (B(n))
|
41
41
|
return `.${o.slice(-3).join(".")}`;
|
42
42
|
}
|
43
43
|
return `.${o.slice(-2).join(".")}`;
|
@@ -51,7 +51,7 @@ function Ie(e) {
|
|
51
51
|
function be(e = {}) {
|
52
52
|
return new URLSearchParams(e).toString();
|
53
53
|
}
|
54
|
-
function
|
54
|
+
function De(e = 1) {
|
55
55
|
let t = e;
|
56
56
|
typeof t == "number" && (t = { expireInDays: t }), t.path === void 0 && (t.path = "/"), t.expireInDays || (t.expireInDays = 1);
|
57
57
|
const o = {
|
@@ -64,7 +64,7 @@ function Se(e = 1) {
|
|
64
64
|
};
|
65
65
|
return (typeof window > "u" || t.domain || t.returnDomain === !1) && t.returnDomain === !1 && delete o.domain, o;
|
66
66
|
}
|
67
|
-
const
|
67
|
+
const Se = (e) => e.color ? e.color : e.dark ? e.theme.palette.common.white : e.theme.palette.text.primary, ke = (e) => e.background ? e.background : e.dark ? e.theme.palette.common.black : e.theme.palette.common.white;
|
68
68
|
function Ve(e, t, o = []) {
|
69
69
|
const n = Object.assign({}, e), i = t.defaultProps || {};
|
70
70
|
return Object.keys(i).forEach((r) => {
|
@@ -95,16 +95,16 @@ const Te = () => typeof Intl == "object" && typeof Intl.DateTimeFormat == "funct
|
|
95
95
|
return o;
|
96
96
|
}, xe = (e) => {
|
97
97
|
const t = Math.round(e / 1e3), o = Math.floor(t / 3600), n = Math.floor((t - o * 3600) / 60), i = t % 60;
|
98
|
-
return `${
|
98
|
+
return `${l(o, 2, "0")}:${l(n, 2, "0")}:${l(i, 2, "0")}`;
|
99
99
|
};
|
100
100
|
function X(e) {
|
101
|
-
|
101
|
+
u = e;
|
102
102
|
}
|
103
103
|
function Ee() {
|
104
|
-
return
|
104
|
+
return u;
|
105
105
|
}
|
106
|
-
const
|
107
|
-
if (
|
106
|
+
const D = (e) => (t, { locale: o, tz: n, isUtc: i } = {}) => {
|
107
|
+
if (u === null && (a.extend(R), a.extend(U), a.extend(F), a.extend(P), a.extend(A), a.updateLocale("zh-cn", {
|
108
108
|
// copy with https://github.com/iamkun/dayjs/blob/dev/src/locale/zh-cn.js
|
109
109
|
relativeTime: {
|
110
110
|
future: "%s后",
|
@@ -123,25 +123,25 @@ const S = (e) => (t, { locale: o, tz: n, isUtc: i } = {}) => {
|
|
123
123
|
}
|
124
124
|
}), X(a)), I(t) || t === "")
|
125
125
|
return "-";
|
126
|
-
let r =
|
126
|
+
let r = u(t);
|
127
127
|
return n && (r = r.tz(n)), i && (r = r.utc()), typeof o < "u" && (r = r.locale(o)), r.format(e);
|
128
128
|
};
|
129
|
-
function
|
130
|
-
return
|
129
|
+
function ve(e, { locale: t = "en", tz: o } = {}) {
|
130
|
+
return D("ll")(e, { locale: t, tz: o });
|
131
131
|
}
|
132
|
-
function
|
132
|
+
function Oe(e, {
|
133
133
|
locale: t = "en",
|
134
134
|
tz: o,
|
135
135
|
isUtc: n = !1,
|
136
136
|
format: i = "lll"
|
137
137
|
} = {}) {
|
138
|
-
return
|
138
|
+
return D(i)(e, { locale: t, tz: o, isUtc: n });
|
139
139
|
}
|
140
140
|
function K() {
|
141
141
|
const e = window?.ABT_DEV || window.ABT;
|
142
142
|
return e && typeof e.open == "function" ? e : null;
|
143
143
|
}
|
144
|
-
function
|
144
|
+
function Ue({
|
145
145
|
webWalletUrl: e,
|
146
146
|
action: t = "login",
|
147
147
|
locale: o = "en",
|
@@ -163,7 +163,7 @@ function Fe({
|
|
163
163
|
...f
|
164
164
|
}
|
165
165
|
}), { type: "extension" };
|
166
|
-
const
|
166
|
+
const S = {
|
167
167
|
toolbar: "no",
|
168
168
|
location: "no",
|
169
169
|
status: "no",
|
@@ -173,7 +173,7 @@ function Fe({
|
|
173
173
|
// iphone 8plus size
|
174
174
|
width: 414,
|
175
175
|
height: 736
|
176
|
-
}, k = `${e}?action=${t}&locale=${o}&url=${encodeURIComponent(n)}`, c = Object.assign({},
|
176
|
+
}, k = `${e}?action=${t}&locale=${o}&url=${encodeURIComponent(n)}`, c = Object.assign({}, S, i), V = (s) => s.innerWidth || s.document.documentElement.clientWidth || s.document.body.clientWidth;
|
177
177
|
if (!("left" in c)) {
|
178
178
|
const s = V(window.top || window), T = window.screenLeft || window.screenX;
|
179
179
|
c.left = s + T - c.width;
|
@@ -185,7 +185,7 @@ function Fe({
|
|
185
185
|
const $ = Object.keys(c).map((s) => `${s}=${c[s]}`).join(",");
|
186
186
|
return window.open(k, "targetWindow", $), { type: "web" };
|
187
187
|
}
|
188
|
-
const
|
188
|
+
const Fe = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", J = (e) => {
|
189
189
|
const t = e.replace(L, "");
|
190
190
|
return !!/^(0x)?[0-9a-f]{40}$/i.test(t);
|
191
191
|
}, Q = (e, t) => {
|
@@ -263,7 +263,7 @@ const Oe = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", J = (e) =
|
|
263
263
|
let r;
|
264
264
|
return t && (r = e[t]), (!r || typeof r != "string") && (r = e[n]), (!r || typeof r != "string") && (r = i), r;
|
265
265
|
}, Me = (e) => j(
|
266
|
-
() =>
|
266
|
+
() => v(
|
267
267
|
async () => {
|
268
268
|
try {
|
269
269
|
return await e();
|
@@ -276,7 +276,7 @@ const Oe = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", J = (e) =
|
|
276
276
|
)
|
277
277
|
), _e = (e) => E(e, I);
|
278
278
|
function ze(e, t = 1) {
|
279
|
-
const [o, n, i] =
|
279
|
+
const [o, n, i] = O.hex.rgb(e);
|
280
280
|
return `rgba(${o}, ${n}, ${i}, ${t})`;
|
281
281
|
}
|
282
282
|
const G = () => window.blocklet?.serverVersion || "", H = () => b.version, Z = () => (b.dependencies?.["@blocklet/js-sdk"]).replace(/^[\^~>=<]+/, ""), d = (e, t) => {
|
@@ -285,7 +285,9 @@ const G = () => window.blocklet?.serverVersion || "", H = () => b.version, Z = (
|
|
285
285
|
return f ? f[1] : r;
|
286
286
|
}, n = o(e), i = o(t);
|
287
287
|
return n === i && e !== t ? !1 : W.gte(n, i);
|
288
|
-
},
|
288
|
+
}, Ne = () => {
|
289
|
+
if (process.env.NODE_ENV === "development")
|
290
|
+
return !0;
|
289
291
|
const e = G(), t = H(), o = Z();
|
290
292
|
if (!e || !t || !o)
|
291
293
|
return !1;
|
@@ -299,16 +301,16 @@ export {
|
|
299
301
|
Ke as deepmergeAll,
|
300
302
|
K as detectWalletExtension,
|
301
303
|
We as ensureVisitorId,
|
302
|
-
|
303
|
-
|
304
|
+
ve as formatToDate,
|
305
|
+
Oe as formatToDatetime,
|
304
306
|
xe as formatUptime,
|
305
307
|
ke as getBackground,
|
306
|
-
|
307
|
-
|
308
|
+
Se as getColor,
|
309
|
+
De as getCookieOptions,
|
308
310
|
$e as getCopyright,
|
309
311
|
Le as getDIDColor,
|
310
312
|
Ee as getDateTool,
|
311
|
-
|
313
|
+
Fe as getFontSize,
|
312
314
|
Z as getJsSdkVersion,
|
313
315
|
G as getServerVersion,
|
314
316
|
Te as getTimezone,
|
@@ -318,12 +320,12 @@ export {
|
|
318
320
|
Y as getVisitorId,
|
319
321
|
ze as hexToRgba,
|
320
322
|
J as isEthereumDid,
|
321
|
-
|
322
|
-
|
323
|
+
Ne as isSupportFollow,
|
324
|
+
B as isTwoSegmentTLD,
|
323
325
|
Re as isUrl,
|
324
326
|
Me as lazyRetry,
|
325
327
|
Ve as mergeProps,
|
326
|
-
|
328
|
+
Ue as openWebWallet,
|
327
329
|
Ie as parseQuery,
|
328
330
|
ye as resolveRootDomain,
|
329
331
|
X as setDateTool,
|
package/lib/package.json.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.33",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -68,16 +68,16 @@
|
|
68
68
|
"react": "^19.0.0",
|
69
69
|
"react-router-dom": "^6.22.3"
|
70
70
|
},
|
71
|
-
"gitHead": "
|
71
|
+
"gitHead": "14bd43c4a02eb7617981ef48276f2fc493058240",
|
72
72
|
"dependencies": {
|
73
|
-
"@arcblock/bridge": "3.1.
|
73
|
+
"@arcblock/bridge": "3.1.33",
|
74
74
|
"@arcblock/did": "^1.21.3",
|
75
75
|
"@arcblock/did-motif": "^1.1.14",
|
76
|
-
"@arcblock/icons": "3.1.
|
77
|
-
"@arcblock/nft-display": "3.1.
|
78
|
-
"@arcblock/react-hooks": "3.1.
|
76
|
+
"@arcblock/icons": "3.1.33",
|
77
|
+
"@arcblock/nft-display": "3.1.33",
|
78
|
+
"@arcblock/react-hooks": "3.1.33",
|
79
79
|
"@blocklet/js-sdk": "^1.16.49-beta-20250823-082650-626c1473",
|
80
|
-
"@blocklet/theme": "3.1.
|
80
|
+
"@blocklet/theme": "3.1.33",
|
81
81
|
"@fontsource/roboto": "~5.1.1",
|
82
82
|
"@fontsource/ubuntu-mono": "^5.2.6",
|
83
83
|
"@iconify-icons/logos": "^1.2.36",
|
@@ -67,7 +67,7 @@ function Chat({
|
|
67
67
|
session?.login(noop, {
|
68
68
|
openMode: 'redirect',
|
69
69
|
redirect: window.location.href,
|
70
|
-
});
|
70
|
+
});
|
71
71
|
return;
|
72
72
|
}
|
73
73
|
window.open(joinURL(discussKitMountPoint, `/chat/dm/${user?.did}`), '_blank');
|
@@ -87,7 +87,8 @@ function Chat({
|
|
87
87
|
<ButtonWrapper
|
88
88
|
className="user-card__social-actions-chat"
|
89
89
|
variant="outlined"
|
90
|
-
color="
|
90
|
+
color="primary"
|
91
|
+
size="small"
|
91
92
|
onClick={onNavigateToChat}>
|
92
93
|
<Icon icon="tabler:message-dots" style={{ marginRight: 4 }} />
|
93
94
|
{t('chat')}
|
@@ -148,7 +149,8 @@ function Follow({
|
|
148
149
|
<ButtonWrapper
|
149
150
|
className="user-card__social-actions-follow"
|
150
151
|
variant="outlined"
|
151
|
-
color="
|
152
|
+
color="primary"
|
153
|
+
size="small"
|
152
154
|
onClick={handleFollowAction}>
|
153
155
|
{followed ? (
|
154
156
|
<NotificationsOffIcon sx={{ fontSize: 14, mr: 0.5 }} />
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { memo } from 'react';
|
2
|
-
import { Typography, Box } from '@mui/material';
|
2
|
+
import { Typography, Box, useMediaQuery, Divider } from '@mui/material';
|
3
3
|
import { DID } from '../../DID';
|
4
4
|
import { User, UserCardProps } from '../types';
|
5
5
|
import TooltipAvatar from './tooltip-avatar';
|
@@ -31,7 +31,7 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
31
31
|
renderName,
|
32
32
|
...rest
|
33
33
|
} = props;
|
34
|
-
|
34
|
+
const isSmallScreen = useMediaQuery('(max-width:500px)');
|
35
35
|
return (
|
36
36
|
<Box
|
37
37
|
className="user-card__avatar-content"
|
@@ -44,10 +44,12 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
44
44
|
sx={{
|
45
45
|
display: 'flex',
|
46
46
|
justifyContent: 'space-between',
|
47
|
-
|
48
|
-
|
47
|
+
flexDirection: isSmallScreen ? 'column' : 'row',
|
48
|
+
alignItems: isSmallScreen ? 'flex-start' : 'center',
|
49
|
+
gap: isSmallScreen ? 2 : 1,
|
49
50
|
flex: 1,
|
50
51
|
minWidth: 0,
|
52
|
+
flexWrap: 'wrap',
|
51
53
|
}}>
|
52
54
|
<Box sx={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'center', gap: 1, flex: 1 }}>
|
53
55
|
<TooltipAvatar
|
@@ -91,7 +93,10 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
91
93
|
) : null}
|
92
94
|
</Box>
|
93
95
|
</Box>
|
94
|
-
<
|
96
|
+
{isSmallScreen ? <Divider sx={{ width: '100%' }} /> : null}
|
97
|
+
{!renderTopRightContent ? (
|
98
|
+
<SocialActions showSocialActions={rest.showSocialActions} user={user!} session={rest.session} />
|
99
|
+
) : null}
|
95
100
|
</Box>
|
96
101
|
{renderTopRight(renderTopRightContent, topRightMaxWidth)}
|
97
102
|
</Box>
|
package/src/Util/index.ts
CHANGED
@@ -710,6 +710,10 @@ export const compareVersions = (version1: string, version2: string) => {
|
|
710
710
|
* 通过 server 的版本和 ux 的版本共同决定
|
711
711
|
*/
|
712
712
|
export const isSupportFollow = () => {
|
713
|
+
// HACK: 本地开发时,为了测试方便,暂时放开限制
|
714
|
+
if (process.env.NODE_ENV === 'development') {
|
715
|
+
return true;
|
716
|
+
}
|
713
717
|
const serverVersion = getServerVersion();
|
714
718
|
const uxVersion = getUxPackageVersion();
|
715
719
|
const jsSdkVersion = getJsSdkVersion();
|