@arcblock/ux 3.0.9 → 3.0.10
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/Address/did-address.js +47 -49
- package/lib/Address/responsive-did-address.js +53 -57
- package/lib/Avatar/index.js +16 -16
- package/lib/BlockletV2/blocklet.js +64 -64
- package/lib/BlockletV2/components/tooltip-icon.js +26 -27
- package/lib/CardSelector/index.js +1 -2
- package/lib/ClickToCopy/hook.js +10 -11
- package/lib/ClickToCopy/index.js +16 -16
- package/lib/Config/theme-mode-toggle.js +7 -8
- package/lib/DID/index.js +131 -133
- package/lib/DIDConnect/app-info-item.js +18 -18
- package/lib/DIDConnect/auth-apps/index.js +83 -84
- package/lib/DIDConnect/did-connect-container.js +89 -90
- package/lib/DIDConnect/did-connect-footer.js +25 -25
- package/lib/DIDConnect/landing-page.js +17 -17
- package/lib/DIDConnect/powered-by.js +11 -11
- package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
- package/lib/DIDConnect/with-container.js +66 -68
- package/lib/Dialog/use-confirm.js +40 -43
- package/lib/Earth/index.js +21 -22
- package/lib/Footer/index.js +15 -16
- package/lib/Header/responsive-header.js +23 -24
- package/lib/Layout/dashboard/index.js +63 -72
- package/lib/Layout/dashboard/sidebar.js +20 -21
- package/lib/Layout/dashboard-legacy/index.js +52 -52
- package/lib/Locale/context.js +36 -37
- package/lib/Locale/selector.js +40 -42
- package/lib/NFTDisplay/index.js +114 -118
- package/lib/NFTDisplay/render-svg.js +12 -12
- package/lib/NavMenu/nav-menu.js +159 -161
- package/lib/NavMenu/sub-container.js +25 -26
- package/lib/PageScroller/index.js +28 -32
- package/lib/Passport/passport.js +11 -11
- package/lib/PhoneInput/country-select.js +38 -38
- package/lib/PhoneInput/index.js +65 -66
- package/lib/Screenshot/index.js +26 -27
- package/lib/SessionBlocklet/index.js +87 -93
- package/lib/SessionPermission/index.js +5 -9
- package/lib/SessionUser/components/did-space.js +24 -25
- package/lib/SessionUser/components/logged-in.js +122 -127
- package/lib/SessionUser/components/quick-login-item.js +41 -42
- package/lib/SessionUser/components/session-user-item.js +35 -36
- package/lib/SessionUser/components/session-user-switch.js +81 -85
- package/lib/SessionUser/components/un-login.js +41 -41
- package/lib/SessionUser/components/user-info.js +43 -47
- package/lib/SessionUser/index.js +1 -1
- package/lib/SessionUser/libs/utils.js +24 -30
- package/lib/SharedBridge/index.js +35 -35
- package/lib/Theme/index.js +16 -16
- package/lib/Theme/theme.js +42 -43
- package/lib/Toast/index.js +24 -25
- package/lib/Typography/index.js +42 -42
- package/lib/UserCard/Content/basic.js +91 -93
- package/lib/UserCard/Content/shorten-label.js +9 -9
- package/lib/UserCard/components.js +15 -15
- package/lib/Util/deprecate.js +1 -1
- package/lib/Util/federated.js +28 -32
- package/lib/Util/iframe.js +9 -10
- package/lib/Util/index.js +134 -135
- package/lib/Util/security.js +9 -10
- package/lib/Util/wallet.js +6 -9
- package/lib/VerificationCode/index.js +26 -28
- package/lib/hooks/use-blocklet-logo.js +11 -14
- package/lib/ux.css +1 -1
- package/lib/withTracker/index.js +13 -14
- package/package.json +9 -10
@@ -1,127 +1,122 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useRef as
|
3
|
-
import { useMemoizedFn as n, useCreation as
|
4
|
-
import
|
5
|
-
import { Box as
|
6
|
-
import { Icon as
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import
|
15
|
-
import { getUserAvatar as
|
16
|
-
import
|
17
|
-
import { DASHBOARD_URL as
|
18
|
-
import
|
19
|
-
import { translations as
|
20
|
-
import { translate as
|
21
|
-
import
|
22
|
-
import { mergeSx as
|
23
|
-
import { createDebug as
|
24
|
-
const
|
25
|
-
const
|
26
|
-
return
|
27
|
-
},
|
28
|
-
function
|
1
|
+
import { jsxs as s, jsx as r, Fragment as W } from "react/jsx-runtime";
|
2
|
+
import { useRef as z, useEffect as j } from "react";
|
3
|
+
import { useMemoizedFn as n, useCreation as T, useReactive as _ } from "ahooks";
|
4
|
+
import f from "@arcblock/bridge";
|
5
|
+
import { Box as S, IconButton as H, Popper as N, ClickAwayListener as Q, Fade as V, Paper as q, Divider as k, MenuList as G, MenuItem as J } from "@mui/material";
|
6
|
+
import { Icon as K } from "@iconify/react";
|
7
|
+
import X from "@iconify-icons/material-symbols/person-outline-rounded";
|
8
|
+
import Y from "@iconify-icons/material-symbols/filter-vintage-outline-rounded";
|
9
|
+
import Z from "@iconify-icons/material-symbols/account-circle-off-outline-rounded";
|
10
|
+
import $ from "@iconify-icons/material-symbols/featured-seasonal-and-gifts-rounded";
|
11
|
+
import ee from "copy-to-clipboard";
|
12
|
+
import h from "lodash/noop";
|
13
|
+
import re from "../../Toast/index.js";
|
14
|
+
import te from "../../Avatar/index.js";
|
15
|
+
import { getUserAvatar as oe } from "../../Util/index.js";
|
16
|
+
import ie from "./user-info.js";
|
17
|
+
import { DASHBOARD_URL as ne, PROFILE_URL as ce } from "../../Util/constant.js";
|
18
|
+
import ae from "../../SessionPermission/index.js";
|
19
|
+
import { translations as le } from "../libs/translation.js";
|
20
|
+
import { translate as se } from "../../Locale/util.js";
|
21
|
+
import pe from "./did-space.js";
|
22
|
+
import { mergeSx as ue } from "../../Util/style.js";
|
23
|
+
import { createDebug as de } from "../../Util/logger.js";
|
24
|
+
const me = (e) => {
|
25
|
+
const c = new URL(window.location.href);
|
26
|
+
return c.searchParams.set("inviter", e), c.toString();
|
27
|
+
}, g = de("did-connect");
|
28
|
+
function We({
|
29
29
|
session: e,
|
30
|
-
onBindWallet:
|
31
|
-
isBlocklet:
|
32
|
-
locale:
|
33
|
-
size:
|
34
|
-
popperType:
|
35
|
-
sx:
|
36
|
-
...
|
30
|
+
onBindWallet: c = h,
|
31
|
+
isBlocklet: a = !0,
|
32
|
+
locale: u = "en",
|
33
|
+
size: b = 24,
|
34
|
+
popperType: I = "click",
|
35
|
+
sx: y,
|
36
|
+
...R
|
37
37
|
}) {
|
38
|
-
|
39
|
-
const u = n((r, o = {}) => de(ue, r, f, "en", o)), L = H(() => {
|
40
|
-
var r, o, a;
|
41
|
-
return !!((a = (o = (r = globalThis == null ? void 0 : globalThis.blocklet) == null ? void 0 : r.settings) == null ? void 0 : o.invite) != null && a.enabled);
|
42
|
-
}, []), x = T(null), h = N({
|
38
|
+
const l = n((t, o = {}) => se(le, t, u, "en", o)), C = T(() => !!globalThis?.blocklet?.settings?.invite?.enabled, []), P = z(null), d = _({
|
43
39
|
open: !1
|
44
|
-
}), i = n((
|
45
|
-
|
46
|
-
}),
|
47
|
-
var a, d, p;
|
40
|
+
}), i = n((t = !d.open) => {
|
41
|
+
d.open = t;
|
42
|
+
}), B = I === "hover" ? { onMouseEnter: () => i(!0), onMouseLeave: () => i(!1) } : { onClick: () => i() }, D = oe(e.user?.avatar?.replace(/\s/g, encodeURIComponent(" "))), L = e.useOAuth(), O = typeof e.usePasskey == "function" ? e.usePasskey() : null, v = n(({ inArcSphere: t = !1 } = {}) => {
|
48
43
|
const o = {};
|
49
|
-
|
50
|
-
}),
|
51
|
-
const
|
52
|
-
o && e.user.sourceAppPid && (
|
53
|
-
const
|
54
|
-
|
44
|
+
t && e?.user?.sourceAppPid && (o.sourceAppPid = e.user.sourceAppPid), i(!1), e?.user?.sourceProvider === "passkey" ? O.switchPassport(e.user) : ["google", "apple", "email", "github"].includes(e?.user?.sourceProvider) ? L.switchOAuthPassport(e.user) : e.switchPassport(h, o);
|
45
|
+
}), x = n(({ userSession: t, inArcSphere: o = !1 } = {}) => new Promise((F) => {
|
46
|
+
const A = {};
|
47
|
+
o && e.user.sourceAppPid && (A.sourceAppPid = e.user.sourceAppPid);
|
48
|
+
const m = {};
|
49
|
+
t ? m.userSession = t : (i(!1), m.showQuickConnect = !1), e.switchDid(
|
55
50
|
() => {
|
56
|
-
i(!1),
|
51
|
+
i(!1), F();
|
57
52
|
},
|
58
|
-
|
59
|
-
|
53
|
+
A,
|
54
|
+
m
|
60
55
|
);
|
61
|
-
})),
|
56
|
+
})), w = n(({ inArcSphere: t = !1 } = {}) => {
|
62
57
|
const o = {};
|
63
|
-
|
64
|
-
}),
|
58
|
+
t && e.user.sourceAppPid && (o.sourceAppPid = e.user.sourceAppPid), i(!1), e.switchProfile(h, o);
|
59
|
+
}), M = n(() => {
|
65
60
|
i(!1), e.logout();
|
66
|
-
}),
|
67
|
-
i(!1), e.bindWallet(
|
68
|
-
}),
|
61
|
+
}), E = n(() => {
|
62
|
+
i(!1), e.bindWallet(c);
|
63
|
+
}), U = n(() => {
|
69
64
|
i(!1);
|
70
|
-
const
|
71
|
-
|
65
|
+
const t = me(e.user.did);
|
66
|
+
ee(t), re.success(l("inviteCopied"));
|
72
67
|
});
|
73
|
-
return
|
74
|
-
|
75
|
-
|
76
|
-
}),
|
77
|
-
|
78
|
-
}),
|
79
|
-
|
68
|
+
return j(() => {
|
69
|
+
f.registerBlocklet("callSwitchPassport", () => {
|
70
|
+
g("bridge registerBlocklet: callSwitchPassport"), v({ inArcSphere: !0 });
|
71
|
+
}), f.registerBlocklet("callSwitchDid", () => {
|
72
|
+
g("bridge registerBlocklet: callSwitchDid"), x({ inArcSphere: !0 });
|
73
|
+
}), f.registerBlocklet("callSwitchProfile", () => {
|
74
|
+
g("bridge registerBlocklet: callSwitchProfile"), w({ inArcSphere: !0 });
|
80
75
|
});
|
81
|
-
}, []), /* @__PURE__ */
|
82
|
-
|
76
|
+
}, []), /* @__PURE__ */ s(
|
77
|
+
S,
|
83
78
|
{
|
84
|
-
sx:
|
79
|
+
sx: ue(
|
85
80
|
{
|
86
81
|
display: "inline-flex",
|
87
82
|
alignItems: "center",
|
88
83
|
justifyContent: "center"
|
89
84
|
},
|
90
85
|
// @ts-ignore
|
91
|
-
|
86
|
+
y
|
92
87
|
),
|
93
|
-
...
|
88
|
+
...R,
|
94
89
|
children: [
|
95
|
-
/* @__PURE__ */
|
96
|
-
|
90
|
+
/* @__PURE__ */ r(
|
91
|
+
H,
|
97
92
|
{
|
98
|
-
ref:
|
93
|
+
ref: P,
|
99
94
|
size: "medium",
|
100
95
|
"data-cy": "sessionManager-logout-popup",
|
101
96
|
className: "arc-session-user-logged-in",
|
102
97
|
"aria-label": "User info button",
|
103
|
-
...
|
104
|
-
children: /* @__PURE__ */
|
98
|
+
...B,
|
99
|
+
children: /* @__PURE__ */ r(te, { variant: "circle", did: e.user.did, src: D, size: b, shape: "circle" })
|
105
100
|
}
|
106
101
|
),
|
107
|
-
/* @__PURE__ */
|
108
|
-
|
102
|
+
/* @__PURE__ */ r(
|
103
|
+
N,
|
109
104
|
{
|
110
|
-
open:
|
111
|
-
anchorEl:
|
105
|
+
open: d.open,
|
106
|
+
anchorEl: P.current,
|
112
107
|
transition: !0,
|
113
108
|
placement: "bottom-end",
|
114
109
|
sx: {
|
115
110
|
zIndex: 1600
|
116
111
|
},
|
117
|
-
children: ({ TransitionProps:
|
118
|
-
|
112
|
+
children: ({ TransitionProps: t }) => /* @__PURE__ */ r(
|
113
|
+
Q,
|
119
114
|
{
|
120
115
|
onClickAway: (o) => {
|
121
116
|
o.preventDefault(), o.stopPropagation(), i(!1);
|
122
117
|
},
|
123
|
-
children: /* @__PURE__ */
|
124
|
-
|
118
|
+
children: /* @__PURE__ */ r(V, { ...t, timeout: 350, children: /* @__PURE__ */ s(
|
119
|
+
q,
|
125
120
|
{
|
126
121
|
variant: "outlined",
|
127
122
|
sx: {
|
@@ -130,62 +125,62 @@ function je({
|
|
130
125
|
maxWidth: "90vw"
|
131
126
|
},
|
132
127
|
children: [
|
133
|
-
/* @__PURE__ */
|
134
|
-
|
128
|
+
/* @__PURE__ */ r(
|
129
|
+
ie,
|
135
130
|
{
|
136
|
-
locale:
|
137
|
-
isBlocklet:
|
131
|
+
locale: u,
|
132
|
+
isBlocklet: a,
|
138
133
|
session: e,
|
139
|
-
onSwitchPassport:
|
140
|
-
onSwitchAccount:
|
141
|
-
onSwitchProfile:
|
142
|
-
onBindWallet:
|
134
|
+
onSwitchPassport: v,
|
135
|
+
onSwitchAccount: x,
|
136
|
+
onSwitchProfile: w,
|
137
|
+
onBindWallet: E
|
143
138
|
}
|
144
139
|
),
|
145
|
-
/* @__PURE__ */
|
146
|
-
/* @__PURE__ */
|
147
|
-
|
148
|
-
/* @__PURE__ */
|
149
|
-
|
140
|
+
/* @__PURE__ */ r(k, { sx: { m: "0 !important" } }),
|
141
|
+
/* @__PURE__ */ s(G, { sx: { p: 0 }, children: [
|
142
|
+
a ? /* @__PURE__ */ s(W, { children: [
|
143
|
+
/* @__PURE__ */ r(ae, { session: e, children: /* @__PURE__ */ r(
|
144
|
+
p,
|
150
145
|
{
|
151
|
-
icon:
|
152
|
-
title:
|
146
|
+
icon: Y,
|
147
|
+
title: l("dashboard"),
|
153
148
|
component: "a",
|
154
|
-
href:
|
149
|
+
href: ne,
|
155
150
|
sx: { display: "block", textDecoration: "none", color: "inherit" }
|
156
151
|
}
|
157
152
|
) }),
|
158
|
-
/* @__PURE__ */
|
159
|
-
|
153
|
+
/* @__PURE__ */ r(
|
154
|
+
p,
|
160
155
|
{
|
161
|
-
icon:
|
162
|
-
title:
|
156
|
+
icon: X,
|
157
|
+
title: l("profile"),
|
163
158
|
component: "a",
|
164
|
-
href:
|
159
|
+
href: ce,
|
165
160
|
sx: { display: "block", textDecoration: "none", color: "inherit" }
|
166
161
|
}
|
167
162
|
),
|
168
|
-
|
169
|
-
|
163
|
+
C && /* @__PURE__ */ r(
|
164
|
+
p,
|
170
165
|
{
|
171
|
-
icon:
|
172
|
-
title:
|
166
|
+
icon: $,
|
167
|
+
title: l("invite"),
|
173
168
|
component: "div",
|
174
|
-
onClick:
|
169
|
+
onClick: U,
|
175
170
|
sx: { display: "block", color: "inherit" }
|
176
171
|
}
|
177
172
|
),
|
178
|
-
/* @__PURE__ */
|
179
|
-
/* @__PURE__ */
|
173
|
+
/* @__PURE__ */ r(k, { sx: { m: "0 !important" } }),
|
174
|
+
/* @__PURE__ */ r(pe, { session: e, locale: u })
|
180
175
|
] }) : null,
|
181
|
-
/* @__PURE__ */
|
182
|
-
|
176
|
+
/* @__PURE__ */ r(
|
177
|
+
p,
|
183
178
|
{
|
184
|
-
icon:
|
185
|
-
title:
|
179
|
+
icon: Z,
|
180
|
+
title: l("logout"),
|
186
181
|
component: "div",
|
187
182
|
sx: { color: "error.main" },
|
188
|
-
onClick:
|
183
|
+
onClick: M,
|
189
184
|
"data-cy": "sessionManager-logout-trigger"
|
190
185
|
}
|
191
186
|
)
|
@@ -201,13 +196,13 @@ function je({
|
|
201
196
|
}
|
202
197
|
);
|
203
198
|
}
|
204
|
-
function
|
199
|
+
function p({
|
205
200
|
icon: e,
|
206
|
-
title:
|
207
|
-
...
|
201
|
+
title: c,
|
202
|
+
...a
|
208
203
|
}) {
|
209
|
-
return /* @__PURE__ */
|
210
|
-
|
204
|
+
return /* @__PURE__ */ r(S, { ...a, sx: { p: 0.5, ...a?.sx }, children: /* @__PURE__ */ s(
|
205
|
+
J,
|
211
206
|
{
|
212
207
|
sx: {
|
213
208
|
display: "flex",
|
@@ -220,12 +215,12 @@ function s({
|
|
220
215
|
py: 1
|
221
216
|
},
|
222
217
|
children: [
|
223
|
-
/* @__PURE__ */
|
224
|
-
|
218
|
+
/* @__PURE__ */ r(K, { icon: e, fontSize: 24 }),
|
219
|
+
c
|
225
220
|
]
|
226
221
|
}
|
227
222
|
) });
|
228
223
|
}
|
229
224
|
export {
|
230
|
-
|
225
|
+
We as default
|
231
226
|
};
|
@@ -1,20 +1,19 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useTheme as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { DID as
|
7
|
-
import
|
8
|
-
import { getSourceProvider as
|
9
|
-
function
|
10
|
-
userSession:
|
11
|
-
locale:
|
12
|
-
onClick:
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { useTheme as m, useMediaQuery as x, Box as r, Typography as a, Chip as f } from "@mui/material";
|
3
|
+
import h from "lodash/noop";
|
4
|
+
import s from "../../RelativeTime/index.js";
|
5
|
+
import g from "../../WalletOSIcon/index.js";
|
6
|
+
import { DID as u } from "../../DID/index.js";
|
7
|
+
import v from "../../Avatar/index.js";
|
8
|
+
import { getSourceProvider as y } from "../libs/utils.js";
|
9
|
+
function T({
|
10
|
+
userSession: e,
|
11
|
+
locale: i = "en",
|
12
|
+
onClick: l = h
|
13
13
|
}) {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
o,
|
14
|
+
const { palette: n } = m(), d = x((p) => p.breakpoints.down("md")), c = y(e?.user) === "wallet";
|
15
|
+
return /* @__PURE__ */ o(
|
16
|
+
r,
|
18
17
|
{
|
19
18
|
sx: {
|
20
19
|
p: 2,
|
@@ -32,10 +31,10 @@ function M({
|
|
32
31
|
},
|
33
32
|
width: "100%"
|
34
33
|
},
|
35
|
-
onClick:
|
34
|
+
onClick: l,
|
36
35
|
children: [
|
37
|
-
/* @__PURE__ */
|
38
|
-
|
36
|
+
/* @__PURE__ */ o(
|
37
|
+
r,
|
39
38
|
{
|
40
39
|
sx: {
|
41
40
|
display: "flex",
|
@@ -45,12 +44,12 @@ function M({
|
|
45
44
|
overflow: "hidden"
|
46
45
|
},
|
47
46
|
children: [
|
48
|
-
/* @__PURE__ */
|
49
|
-
/* @__PURE__ */
|
50
|
-
/* @__PURE__ */
|
51
|
-
|
47
|
+
/* @__PURE__ */ t(v, { src: e.user.avatar, did: e.user.did, size: 44, variant: "circle", shape: "circle" }),
|
48
|
+
/* @__PURE__ */ o(r, { sx: { flex: 1, overflow: "hidden" }, children: [
|
49
|
+
/* @__PURE__ */ o(
|
50
|
+
a,
|
52
51
|
{
|
53
|
-
component:
|
52
|
+
component: r,
|
54
53
|
sx: {
|
55
54
|
fontSize: "16px",
|
56
55
|
fontWeight: 500,
|
@@ -60,11 +59,11 @@ function M({
|
|
60
59
|
color: "text.primary"
|
61
60
|
},
|
62
61
|
children: [
|
63
|
-
|
64
|
-
/* @__PURE__ */
|
65
|
-
|
62
|
+
e.user.fullName,
|
63
|
+
/* @__PURE__ */ t(
|
64
|
+
f,
|
66
65
|
{
|
67
|
-
label:
|
66
|
+
label: e.user?.roleTitle || e.user?.role,
|
68
67
|
size: "small",
|
69
68
|
variant: "outlined",
|
70
69
|
sx: () => ({
|
@@ -79,8 +78,8 @@ function M({
|
|
79
78
|
]
|
80
79
|
}
|
81
80
|
),
|
82
|
-
|
83
|
-
|
81
|
+
c ? /* @__PURE__ */ o(
|
82
|
+
r,
|
84
83
|
{
|
85
84
|
sx: {
|
86
85
|
display: "flex",
|
@@ -88,19 +87,19 @@ function M({
|
|
88
87
|
gap: 0.5
|
89
88
|
},
|
90
89
|
children: [
|
91
|
-
/* @__PURE__ */
|
92
|
-
|
90
|
+
/* @__PURE__ */ t(
|
91
|
+
g,
|
93
92
|
{
|
94
|
-
provider:
|
95
|
-
walletOS:
|
96
|
-
color:
|
93
|
+
provider: e?.extra?.provider,
|
94
|
+
walletOS: e?.extra?.walletOS,
|
95
|
+
color: n.text.secondary
|
97
96
|
}
|
98
97
|
),
|
99
|
-
/* @__PURE__ */
|
100
|
-
|
98
|
+
/* @__PURE__ */ t(
|
99
|
+
u,
|
101
100
|
{
|
102
|
-
locale:
|
103
|
-
did:
|
101
|
+
locale: i,
|
102
|
+
did: e.user.did,
|
104
103
|
size: 12,
|
105
104
|
sx: {
|
106
105
|
lineHeight: 1,
|
@@ -115,16 +114,16 @@ function M({
|
|
115
114
|
)
|
116
115
|
]
|
117
116
|
}
|
118
|
-
) : /* @__PURE__ */
|
117
|
+
) : /* @__PURE__ */ t(a, { sx: { fontSize: "12px", color: "text.secondary" }, children: e.user.email })
|
119
118
|
] })
|
120
119
|
]
|
121
120
|
}
|
122
121
|
),
|
123
|
-
|
122
|
+
e.updatedAt && !d && /* @__PURE__ */ t(r, { component: "span", sx: { color: "text.hint", fontSize: "12px", flexShrink: 0 }, children: /* @__PURE__ */ t(s, { value: e.updatedAt, locale: i }) })
|
124
123
|
]
|
125
124
|
}
|
126
125
|
);
|
127
126
|
}
|
128
127
|
export {
|
129
|
-
|
128
|
+
T as default
|
130
129
|
};
|
@@ -1,25 +1,24 @@
|
|
1
|
-
import { jsxs as t, jsx as
|
2
|
-
import { useTheme as
|
3
|
-
import { Icon as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import { DID as
|
8
|
-
import { getSourceProvider as
|
9
|
-
function
|
10
|
-
ref:
|
11
|
-
sessionItem:
|
12
|
-
statusContent:
|
13
|
-
active:
|
14
|
-
...
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { useTheme as c, Box as o, Tooltip as s, Typography as f, IconButton as m } from "@mui/material";
|
3
|
+
import { Icon as u } from "@iconify/react";
|
4
|
+
import x from "@iconify-icons/material-symbols/lens";
|
5
|
+
import h from "../../WalletOSIcon/index.js";
|
6
|
+
import v from "../../Avatar/index.js";
|
7
|
+
import { DID as y } from "../../DID/index.js";
|
8
|
+
import { getSourceProvider as w } from "../libs/utils.js";
|
9
|
+
function T({
|
10
|
+
ref: a = void 0,
|
11
|
+
sessionItem: e,
|
12
|
+
statusContent: n = null,
|
13
|
+
active: d = !1,
|
14
|
+
...i
|
15
15
|
}) {
|
16
|
-
|
17
|
-
const { palette: o } = u(), f = z(r == null ? void 0 : r.user) === "wallet";
|
16
|
+
const { palette: l } = c(), p = w(e?.user) === "wallet";
|
18
17
|
return /* @__PURE__ */ t(
|
19
|
-
|
18
|
+
o,
|
20
19
|
{
|
21
|
-
...
|
22
|
-
ref:
|
20
|
+
...i,
|
21
|
+
ref: a,
|
23
22
|
sx: {
|
24
23
|
display: "flex",
|
25
24
|
alignItems: "center",
|
@@ -27,11 +26,11 @@ function R({
|
|
27
26
|
py: 0.75,
|
28
27
|
px: 1,
|
29
28
|
width: "100%",
|
30
|
-
...
|
29
|
+
...i?.sx
|
31
30
|
},
|
32
31
|
children: [
|
33
32
|
/* @__PURE__ */ t(
|
34
|
-
|
33
|
+
o,
|
35
34
|
{
|
36
35
|
sx: {
|
37
36
|
display: "flex",
|
@@ -43,33 +42,33 @@ function R({
|
|
43
42
|
}
|
44
43
|
},
|
45
44
|
children: [
|
46
|
-
/* @__PURE__ */
|
47
|
-
/* @__PURE__ */
|
48
|
-
|
45
|
+
/* @__PURE__ */ r(o, { sx: { mr: 0.5, fontSize: 0 }, children: /* @__PURE__ */ r(v, { did: e.userDid, size: 36 }) }),
|
46
|
+
/* @__PURE__ */ r(
|
47
|
+
h,
|
49
48
|
{
|
50
|
-
color:
|
51
|
-
loading:
|
52
|
-
provider:
|
53
|
-
walletOS:
|
49
|
+
color: l.text.secondary,
|
50
|
+
loading: e.__isDefault,
|
51
|
+
provider: e?.extra?.provider,
|
52
|
+
walletOS: e?.extra?.walletOS
|
54
53
|
}
|
55
54
|
),
|
56
|
-
|
57
|
-
|
55
|
+
p ? /* @__PURE__ */ r(y, { did: e.userDid, copyable: !1, size: 14, responsive: !1, compact: !0, sx: { lineHeight: 1 } }) : e.user.email && /* @__PURE__ */ r(
|
56
|
+
s,
|
58
57
|
{
|
59
|
-
title:
|
58
|
+
title: e.user.email,
|
60
59
|
sx: {
|
61
60
|
zIndex: 1600
|
62
61
|
},
|
63
62
|
placement: "top",
|
64
|
-
children: /* @__PURE__ */
|
65
|
-
|
63
|
+
children: /* @__PURE__ */ r(
|
64
|
+
f,
|
66
65
|
{
|
67
66
|
sx: {
|
68
67
|
fontSize: 14,
|
69
68
|
overflow: "hidden",
|
70
69
|
textOverflow: "ellipsis"
|
71
70
|
},
|
72
|
-
children:
|
71
|
+
children: e.user.email
|
73
72
|
}
|
74
73
|
)
|
75
74
|
}
|
@@ -77,11 +76,11 @@ function R({
|
|
77
76
|
]
|
78
77
|
}
|
79
78
|
),
|
80
|
-
|
79
|
+
n || d && /* @__PURE__ */ r(m, { size: "small", disableRipple: !0, children: /* @__PURE__ */ r(u, { icon: x, fontSize: 6, color: l.success.main }) })
|
81
80
|
]
|
82
81
|
}
|
83
82
|
);
|
84
83
|
}
|
85
84
|
export {
|
86
|
-
|
85
|
+
T as default
|
87
86
|
};
|