@blocklet/ui-react 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/BlockletStudio/index.js +70 -71
- package/lib/ComponentInstaller/index.js +85 -88
- package/lib/ComponentInstaller/installer-item.js +47 -53
- package/lib/ComponentInstaller/use-component-installed.js +32 -38
- package/lib/ComponentManager/components/add-component.js +47 -50
- package/lib/ComponentManager/components/publish-component.js +30 -31
- package/lib/ComponentManager/components/resource-dialog.js +28 -30
- package/lib/Dashboard/index.d.ts +1 -1
- package/lib/Dashboard/index.js +59 -61
- package/lib/Footer/index.js +51 -52
- package/lib/Footer/internal-footer.js +43 -47
- package/lib/Footer/layout/standard.js +11 -12
- package/lib/Footer/links.js +25 -28
- package/lib/Footer/social-media.js +17 -17
- package/lib/Header/index.js +81 -83
- package/lib/Notifications/Snackbar.js +76 -77
- package/lib/Notifications/hooks/use-title.js +34 -34
- package/lib/Notifications/utils.js +56 -60
- package/lib/UserCenter/components/config-inviter.js +17 -18
- package/lib/UserCenter/components/danger-zone.js +49 -52
- package/lib/UserCenter/components/nft.js +44 -45
- package/lib/UserCenter/components/notification.js +92 -99
- package/lib/UserCenter/components/passport.js +22 -22
- package/lib/UserCenter/components/privacy.js +6 -6
- package/lib/UserCenter/components/settings.js +40 -43
- package/lib/UserCenter/components/status-dialog/date-picker.js +7 -8
- package/lib/UserCenter/components/status-dialog/index.js +112 -114
- package/lib/UserCenter/components/status-selector/duration-menu.js +35 -36
- package/lib/UserCenter/components/status-selector/index.js +13 -13
- package/lib/UserCenter/components/storage/action.js +21 -22
- package/lib/UserCenter/components/storage/delete.js +24 -24
- package/lib/UserCenter/components/third-party-login/index.js +53 -53
- package/lib/UserCenter/components/third-party-login/third-party-item.js +87 -89
- package/lib/UserCenter/components/user-center.js +198 -207
- package/lib/UserCenter/components/user-info/metadata.js +343 -353
- package/lib/UserCenter/components/user-info/switch-role.js +17 -20
- package/lib/UserCenter/components/user-info/user-basic-info.js +79 -82
- package/lib/UserCenter/components/user-info/user-info.js +40 -40
- package/lib/UserCenter/components/user-info/user-status.js +97 -99
- package/lib/UserCenter/components/user-info/utils.js +34 -35
- package/lib/UserSessions/components/user-session-info.js +25 -28
- package/lib/UserSessions/components/user-sessions.js +169 -181
- package/lib/blocklets.js +62 -72
- package/lib/common/domain-warning.js +31 -31
- package/lib/common/header-addons.d.ts +1 -1
- package/lib/common/header-addons.js +49 -53
- package/lib/common/notification-addon.js +29 -32
- package/lib/common/ws.js +17 -18
- package/lib/contexts/config-user-space.js +16 -19
- package/lib/utils.js +44 -48
- package/package.json +6 -6
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import { jsx as s, jsxs as L, Fragment as O } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import p from "lodash/noop";
|
|
3
3
|
import { use as k, useState as H } from "react";
|
|
4
4
|
import { Box as U } from "@mui/material";
|
|
5
|
-
import { useAsyncEffect as
|
|
6
|
-
import { getConnectedAccounts as
|
|
7
|
-
import { LOGIN_PROVIDER as
|
|
8
|
-
import { SessionContext as
|
|
5
|
+
import { useAsyncEffect as b, useCreation as u } from "ahooks";
|
|
6
|
+
import { getConnectedAccounts as v, getSourceProvider as B } from "@arcblock/ux/lib/SessionUser/libs/utils";
|
|
7
|
+
import { LOGIN_PROVIDER as o } from "@arcblock/ux/lib/Util/constant";
|
|
8
|
+
import { SessionContext as G } from "@arcblock/did-connect/lib/Session";
|
|
9
9
|
import { PasskeyActions as T } from "@arcblock/did-connect/lib/Passkey";
|
|
10
|
-
import { useBrowser as
|
|
11
|
-
import
|
|
12
|
-
function q({ user:
|
|
13
|
-
const { session: C } = k(
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
sourceAppPid:
|
|
10
|
+
import { useBrowser as I } from "@arcblock/react-hooks";
|
|
11
|
+
import l from "./third-party-item.js";
|
|
12
|
+
function q({ user: i }) {
|
|
13
|
+
const { session: C } = k(G), [f, w] = H({}), { getOAuthConfigs: E } = C.useOAuth(), A = I();
|
|
14
|
+
b(async () => {
|
|
15
|
+
const r = await E({
|
|
16
|
+
sourceAppPid: i?.sourceAppPid
|
|
17
17
|
});
|
|
18
|
-
w(
|
|
19
|
-
}, [
|
|
20
|
-
const P =
|
|
21
|
-
...
|
|
22
|
-
provider:
|
|
23
|
-
})).filter((
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
if (
|
|
18
|
+
w(r);
|
|
19
|
+
}, [i?.sourceAppPid]);
|
|
20
|
+
const P = u(() => Object.keys(f).map((n) => ({
|
|
21
|
+
...f[n],
|
|
22
|
+
provider: n
|
|
23
|
+
})).filter((n) => n.enabled), [f]), h = u(() => {
|
|
24
|
+
const r = v(i);
|
|
25
|
+
let n = !1, t = "", d = B(i);
|
|
26
|
+
const a = r.find((e) => e.provider === o.AUTH0);
|
|
27
|
+
return a && (a.id.startsWith("google-oauth2|") && (r.some((e) => e.provider === "google") || (n = !0, t = o.GOOGLE, d === o.AUTH0 && (d = o.GOOGLE))), a.id.startsWith("appleid|") && (r.some((e) => e.provider === o.APPLE) || (n = !0, t = o.APPLE, d === o.AUTH0 && (d = o.APPLE))), a.id.startsWith("github|") && (r.some((e) => e.provider === o.GITHUB) || (n = !0, t = o.GITHUB, d === o.AUTH0 && (d = o.GITHUB)))), P.map((e) => {
|
|
28
|
+
if (e.provider === o.AUTH0 && n)
|
|
29
29
|
return null;
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
-
...
|
|
33
|
-
provider:
|
|
34
|
-
did:
|
|
35
|
-
pk:
|
|
36
|
-
userInfo:
|
|
30
|
+
const c = n && e.provider === t ? r.find((m) => m.provider === o.AUTH0) : r.find((m) => m.provider === e.provider);
|
|
31
|
+
return c ? {
|
|
32
|
+
...e,
|
|
33
|
+
provider: e.provider,
|
|
34
|
+
did: c.did,
|
|
35
|
+
pk: c.pk,
|
|
36
|
+
userInfo: c.userInfo,
|
|
37
37
|
_bind: !0,
|
|
38
|
-
_rawProvider:
|
|
39
|
-
_mainProvider:
|
|
38
|
+
_rawProvider: c.provider,
|
|
39
|
+
_mainProvider: e.provider === d
|
|
40
40
|
} : {
|
|
41
|
-
...
|
|
42
|
-
provider:
|
|
43
|
-
_rawProvider:
|
|
44
|
-
_mainProvider:
|
|
41
|
+
...e,
|
|
42
|
+
provider: e.provider,
|
|
43
|
+
_rawProvider: e.provider,
|
|
44
|
+
_mainProvider: e.provider === d
|
|
45
45
|
};
|
|
46
|
-
}).filter(Boolean).sort((
|
|
47
|
-
}, [
|
|
48
|
-
(
|
|
49
|
-
).map((
|
|
50
|
-
...
|
|
46
|
+
}).filter(Boolean).sort((e, c) => e?.order !== void 0 && c?.order !== void 0 ? e.order - c.order : e?.order !== void 0 ? -1 : 1);
|
|
47
|
+
}, [i?.connectedAccounts, P]), g = u(() => v(i).filter(
|
|
48
|
+
(t) => t.provider === o.PASSKEY && t.did !== i?.did
|
|
49
|
+
).map((t) => ({
|
|
50
|
+
...t,
|
|
51
51
|
_bind: !0
|
|
52
|
-
})), [
|
|
53
|
-
(
|
|
54
|
-
).map((
|
|
55
|
-
...
|
|
52
|
+
})), [i]), y = u(() => v(i).filter(
|
|
53
|
+
(t) => t.provider === o.WALLET && t.did !== i?.did
|
|
54
|
+
).map((t) => ({
|
|
55
|
+
...t,
|
|
56
56
|
_mainProvider: !0
|
|
57
|
-
})), [
|
|
57
|
+
})), [i]);
|
|
58
58
|
return /* @__PURE__ */ s(
|
|
59
59
|
U,
|
|
60
60
|
{
|
|
@@ -70,14 +70,14 @@ function q({ user: r }) {
|
|
|
70
70
|
action: "connect",
|
|
71
71
|
createMode: "connect",
|
|
72
72
|
createButtonText: "Add Passkey",
|
|
73
|
-
onSuccess:
|
|
74
|
-
onError:
|
|
73
|
+
onSuccess: p,
|
|
74
|
+
onError: p,
|
|
75
75
|
dense: !0
|
|
76
76
|
}
|
|
77
77
|
) : /* @__PURE__ */ L(O, { children: [
|
|
78
|
-
h.map((
|
|
79
|
-
g.map((
|
|
80
|
-
y.map((
|
|
78
|
+
h.map((r) => /* @__PURE__ */ s(l, { item: r }, r?.provider)),
|
|
79
|
+
g.map((r) => /* @__PURE__ */ s(l, { item: r }, r.id)),
|
|
80
|
+
y.map((r) => /* @__PURE__ */ s(l, { item: r }, r.id)),
|
|
81
81
|
A.wallet || A.arcSphere ? null : /* @__PURE__ */ s(
|
|
82
82
|
T,
|
|
83
83
|
{
|
|
@@ -85,8 +85,8 @@ function q({ user: r }) {
|
|
|
85
85
|
action: "connect",
|
|
86
86
|
createMode: "connect",
|
|
87
87
|
createButtonText: "Add New Passkey",
|
|
88
|
-
onSuccess:
|
|
89
|
-
onError:
|
|
88
|
+
onSuccess: p,
|
|
89
|
+
onError: p,
|
|
90
90
|
dense: !0,
|
|
91
91
|
sx: {
|
|
92
92
|
px: 1.5,
|
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import { jsxs as s, Fragment as
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Box as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useReactive as
|
|
8
|
-
import { translate as
|
|
9
|
-
import { useConfirm as
|
|
10
|
-
import { useLocaleContext as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { SessionContext as
|
|
19
|
-
import { use as
|
|
20
|
-
import
|
|
21
|
-
import { getFederatedEnabled as
|
|
22
|
-
import { LOGIN_PROVIDER as
|
|
23
|
-
import { useStateContext as
|
|
24
|
-
import { translations as
|
|
25
|
-
function
|
|
1
|
+
import { jsxs as s, Fragment as P, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as m } from "@iconify/react";
|
|
3
|
+
import { Box as c, Tooltip as y, Typography as I } from "@mui/material";
|
|
4
|
+
import E from "@iconify-icons/material-symbols/link-rounded";
|
|
5
|
+
import z from "@arcblock/ux/lib/Button";
|
|
6
|
+
import G from "@arcblock/ux/lib/Avatar";
|
|
7
|
+
import { useReactive as H, useMemoizedFn as k, useCreation as v } from "ahooks";
|
|
8
|
+
import { translate as M } from "@arcblock/ux/lib/Locale/util";
|
|
9
|
+
import { useConfirm as D } from "@arcblock/ux/lib/Dialog";
|
|
10
|
+
import { useLocaleContext as F } from "@arcblock/ux/lib/Locale/context";
|
|
11
|
+
import W from "@iconify-icons/material-symbols/mail-outline-rounded";
|
|
12
|
+
import N from "@iconify-icons/material-symbols/info-outline-rounded";
|
|
13
|
+
import K from "@iconify-icons/material-symbols/passkey";
|
|
14
|
+
import V from "@iconify-icons/material-symbols/wallet-sharp";
|
|
15
|
+
import Y from "@iconify-icons/logos/apple";
|
|
16
|
+
import j from "@iconify-icons/logos/github-icon";
|
|
17
|
+
import $ from "@iconify-icons/logos/google-icon";
|
|
18
|
+
import { SessionContext as q } from "@arcblock/did-connect/lib/Session";
|
|
19
|
+
import { use as J } from "react";
|
|
20
|
+
import Q from "lodash/pick";
|
|
21
|
+
import { getFederatedEnabled as X, getMaster as Z } from "@arcblock/ux/lib/Util/federated";
|
|
22
|
+
import { LOGIN_PROVIDER as a, LOGIN_PROVIDER_NAME as oo } from "@arcblock/ux/lib/Util/constant";
|
|
23
|
+
import { useStateContext as ro } from "@arcblock/did-connect/lib/Connect/contexts/state";
|
|
24
|
+
import { translations as no } from "../../libs/locales.js";
|
|
25
|
+
function Ao({
|
|
26
26
|
item: o
|
|
27
27
|
}) {
|
|
28
|
-
|
|
29
|
-
const { blocklet: u } = io(), { confirmApi: x, confirmHolder: O } = Y(), p = K({
|
|
28
|
+
const { blocklet: w } = ro(), { confirmApi: f, confirmHolder: C } = D(), p = H({
|
|
30
29
|
loading: !1
|
|
31
|
-
}), { locale:
|
|
30
|
+
}), { locale: B } = F(), e = k((r, t = {}) => M(no, r, B, "en", t)), { session: l } = J(q), { bindOAuth: S, unbindOAuth: A, setBaseUrl: u, baseUrl: L } = l.useOAuth(), { disconnectPasskey: _, setTargetAppPid: h } = l.usePasskey(), O = {
|
|
32
31
|
// email: MailOutlineRoundedIcon,
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
},
|
|
40
|
-
if (
|
|
41
|
-
await new Promise((r,
|
|
42
|
-
|
|
32
|
+
[a.AUTH0]: W,
|
|
33
|
+
[a.APPLE]: Y,
|
|
34
|
+
[a.GITHUB]: j,
|
|
35
|
+
[a.GOOGLE]: $,
|
|
36
|
+
[a.PASSKEY]: K,
|
|
37
|
+
[a.WALLET]: V
|
|
38
|
+
}, R = v(() => O[o?.provider], [o?.provider]), d = v(() => oo[o?.provider] || "unknown", [o?.provider]), T = k(async () => {
|
|
39
|
+
if (o?.provider === a.PASSKEY) {
|
|
40
|
+
await new Promise((r, t) => {
|
|
41
|
+
f.open({
|
|
43
42
|
title: e("thirdPartyLogin.disconnectPasskey", { name: d }),
|
|
44
43
|
content: e("thirdPartyLogin.disconnectPasskeyDescription", { name: d }),
|
|
45
44
|
confirmButtonText: e("common.confirm"),
|
|
@@ -48,7 +47,7 @@ function Uo({
|
|
|
48
47
|
},
|
|
49
48
|
cancelButtonText: e("common.cancel"),
|
|
50
49
|
onConfirm(i) {
|
|
51
|
-
|
|
50
|
+
_({ session: l, connectedAccount: o }).then(r).catch(t), i();
|
|
52
51
|
},
|
|
53
52
|
// @ts-ignore
|
|
54
53
|
onCancel: r
|
|
@@ -57,10 +56,9 @@ function Uo({
|
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
59
58
|
try {
|
|
60
|
-
p.loading = !0, await new Promise((r,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
x.open({
|
|
59
|
+
p.loading = !0, await new Promise((r, t) => {
|
|
60
|
+
if (o?._bind)
|
|
61
|
+
f.open({
|
|
64
62
|
title: e("thirdPartyLogin.confirmUnbind", { name: d }),
|
|
65
63
|
content: e("thirdPartyLogin.confirmUnbindDescription", { name: d }),
|
|
66
64
|
confirmButtonText: e("common.confirm"),
|
|
@@ -68,43 +66,43 @@ function Uo({
|
|
|
68
66
|
color: "error"
|
|
69
67
|
},
|
|
70
68
|
cancelButtonText: e("common.cancel"),
|
|
71
|
-
onConfirm(
|
|
72
|
-
|
|
73
|
-
session:
|
|
69
|
+
onConfirm(i) {
|
|
70
|
+
A({
|
|
71
|
+
session: l,
|
|
74
72
|
connectedAccount: {
|
|
75
|
-
...
|
|
73
|
+
...Q(o, ["did", "pk"]),
|
|
76
74
|
showProvider: o.provider,
|
|
77
75
|
provider: o._rawProvider
|
|
78
76
|
}
|
|
79
|
-
}).then(r).catch(
|
|
77
|
+
}).then(r).catch(t), i();
|
|
80
78
|
},
|
|
81
79
|
// @ts-ignore
|
|
82
80
|
onCancel: r
|
|
83
81
|
});
|
|
84
82
|
else {
|
|
85
|
-
const
|
|
86
|
-
let
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
session:
|
|
83
|
+
const i = L, g = window?.blocklet;
|
|
84
|
+
let x = "/";
|
|
85
|
+
const U = X(g), b = Z(g);
|
|
86
|
+
U && b?.appPid && l?.user?.sourceAppPid && (x = b.appUrl), u(x), h(w?.appPid), S({
|
|
87
|
+
session: l,
|
|
90
88
|
oauthItem: {
|
|
91
89
|
...o,
|
|
92
90
|
provider: o._rawProvider
|
|
93
91
|
}
|
|
94
|
-
}).then(r).catch(
|
|
95
|
-
|
|
92
|
+
}).then(r).catch(t).finally(() => {
|
|
93
|
+
u(i), h();
|
|
96
94
|
});
|
|
97
95
|
}
|
|
98
96
|
});
|
|
99
97
|
} catch (r) {
|
|
100
|
-
console.error(`Failed to ${o
|
|
98
|
+
console.error(`Failed to ${o?._bind ? "unbind" : "bind"} oauth account`, r);
|
|
101
99
|
} finally {
|
|
102
100
|
p.loading = !1;
|
|
103
101
|
}
|
|
104
102
|
});
|
|
105
|
-
return /* @__PURE__ */ s(
|
|
103
|
+
return /* @__PURE__ */ s(P, { children: [
|
|
106
104
|
/* @__PURE__ */ s(
|
|
107
|
-
|
|
105
|
+
c,
|
|
108
106
|
{
|
|
109
107
|
sx: {
|
|
110
108
|
borderRadius: 1,
|
|
@@ -122,10 +120,10 @@ function Uo({
|
|
|
122
120
|
},
|
|
123
121
|
children: [
|
|
124
122
|
/* @__PURE__ */ n(
|
|
125
|
-
|
|
123
|
+
c,
|
|
126
124
|
{
|
|
127
|
-
component:
|
|
128
|
-
icon:
|
|
125
|
+
component: m,
|
|
126
|
+
icon: R,
|
|
129
127
|
fill: "currentColor",
|
|
130
128
|
sx: {
|
|
131
129
|
width: "1em",
|
|
@@ -133,12 +131,12 @@ function Uo({
|
|
|
133
131
|
flexShrink: 0,
|
|
134
132
|
fontSize: 16,
|
|
135
133
|
// githubIcon 不支持变色,dark 模式做一个反色处理
|
|
136
|
-
filter: ({ palette: r }) =>
|
|
134
|
+
filter: ({ palette: r }) => o?.provider === a.GITHUB && r.mode === "dark" ? "invert(1)" : "none"
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
),
|
|
140
138
|
/* @__PURE__ */ n(
|
|
141
|
-
|
|
139
|
+
c,
|
|
142
140
|
{
|
|
143
141
|
sx: {
|
|
144
142
|
flex: 1
|
|
@@ -147,7 +145,7 @@ function Uo({
|
|
|
147
145
|
}
|
|
148
146
|
),
|
|
149
147
|
/* @__PURE__ */ s(
|
|
150
|
-
|
|
148
|
+
c,
|
|
151
149
|
{
|
|
152
150
|
sx: {
|
|
153
151
|
display: "flex",
|
|
@@ -156,7 +154,7 @@ function Uo({
|
|
|
156
154
|
},
|
|
157
155
|
children: [
|
|
158
156
|
/* @__PURE__ */ n(
|
|
159
|
-
|
|
157
|
+
c,
|
|
160
158
|
{
|
|
161
159
|
sx: {
|
|
162
160
|
flex: 1,
|
|
@@ -164,44 +162,44 @@ function Uo({
|
|
|
164
162
|
overflow: "hidden",
|
|
165
163
|
lineHeight: "normal"
|
|
166
164
|
},
|
|
167
|
-
children:
|
|
165
|
+
children: o.userInfo?.email || o.did
|
|
168
166
|
}
|
|
169
167
|
),
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
o.userInfo?.name ? /* @__PURE__ */ n(
|
|
169
|
+
y,
|
|
172
170
|
{
|
|
173
|
-
title: /* @__PURE__ */ n(
|
|
174
|
-
/* @__PURE__ */ n(
|
|
175
|
-
/* @__PURE__ */ s(
|
|
171
|
+
title: /* @__PURE__ */ n(P, { children: /* @__PURE__ */ s(c, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
172
|
+
/* @__PURE__ */ n(G, { size: 36, variant: "circle", shape: "circle", src: o.userInfo?.picture, did: o.did }),
|
|
173
|
+
/* @__PURE__ */ s(c, { children: [
|
|
176
174
|
/* @__PURE__ */ n(
|
|
177
|
-
|
|
175
|
+
I,
|
|
178
176
|
{
|
|
179
177
|
sx: {
|
|
180
178
|
whiteSpace: "normal",
|
|
181
179
|
wordBreak: "break-all",
|
|
182
180
|
fontSize: "0.9rem"
|
|
183
181
|
},
|
|
184
|
-
children:
|
|
182
|
+
children: o.userInfo?.name
|
|
185
183
|
}
|
|
186
184
|
),
|
|
187
185
|
/* @__PURE__ */ n(
|
|
188
|
-
|
|
186
|
+
I,
|
|
189
187
|
{
|
|
190
188
|
sx: {
|
|
191
189
|
whiteSpace: "normal",
|
|
192
190
|
wordBreak: "break-all",
|
|
193
191
|
fontSize: "0.9rem"
|
|
194
192
|
},
|
|
195
|
-
children:
|
|
193
|
+
children: o.userInfo?.email
|
|
196
194
|
}
|
|
197
195
|
)
|
|
198
196
|
] })
|
|
199
197
|
] }) }),
|
|
200
198
|
children: /* @__PURE__ */ n(
|
|
201
|
-
|
|
199
|
+
c,
|
|
202
200
|
{
|
|
203
|
-
component:
|
|
204
|
-
icon:
|
|
201
|
+
component: m,
|
|
202
|
+
icon: N,
|
|
205
203
|
sx: {
|
|
206
204
|
color: "text.secondary",
|
|
207
205
|
fontSize: 16,
|
|
@@ -218,19 +216,19 @@ function Uo({
|
|
|
218
216
|
]
|
|
219
217
|
}
|
|
220
218
|
),
|
|
221
|
-
/* @__PURE__ */ n(
|
|
222
|
-
|
|
219
|
+
/* @__PURE__ */ n(y, { title: o._mainProvider ? e("thirdPartyLogin.mainProviderCantRemove") : "", children: /* @__PURE__ */ n(c, { children: /* @__PURE__ */ n(
|
|
220
|
+
z,
|
|
223
221
|
{
|
|
224
222
|
variant: "outlined",
|
|
225
223
|
size: "small",
|
|
226
224
|
sx: (r) => {
|
|
227
|
-
const
|
|
225
|
+
const t = r.palette.error.main, i = r.palette.primary.main;
|
|
228
226
|
return {
|
|
229
|
-
color: o
|
|
230
|
-
borderColor: o
|
|
227
|
+
color: o?._bind ? t : i,
|
|
228
|
+
borderColor: o?._bind ? t : i,
|
|
231
229
|
backgroundColor: "background.default",
|
|
232
230
|
"&:hover": {
|
|
233
|
-
borderColor: o
|
|
231
|
+
borderColor: o?._bind ? t : i,
|
|
234
232
|
backgroundColor: "action.hover"
|
|
235
233
|
},
|
|
236
234
|
py: 0.5,
|
|
@@ -240,16 +238,16 @@ function Uo({
|
|
|
240
238
|
};
|
|
241
239
|
},
|
|
242
240
|
fullWidth: !0,
|
|
243
|
-
startIcon: p.loading ? null : /* @__PURE__ */ n(
|
|
244
|
-
onClick:
|
|
241
|
+
startIcon: p.loading ? null : /* @__PURE__ */ n(m, { icon: E }),
|
|
242
|
+
onClick: T,
|
|
245
243
|
disabled: o._mainProvider,
|
|
246
244
|
loading: p.loading,
|
|
247
|
-
children: o
|
|
245
|
+
children: o?._bind ? e("thirdPartyLogin.disconnect") : e("thirdPartyLogin.connect")
|
|
248
246
|
}
|
|
249
247
|
) }) }),
|
|
250
|
-
|
|
248
|
+
C
|
|
251
249
|
] });
|
|
252
250
|
}
|
|
253
251
|
export {
|
|
254
|
-
|
|
252
|
+
Ao as default
|
|
255
253
|
};
|