@xyo-network/react-connected-accounts 7.5.8 → 7.5.11
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/dist/browser/classes/EnabledWallets.d.ts +5 -9
- package/dist/browser/classes/EnabledWallets.d.ts.map +1 -1
- package/dist/browser/hooks/useEnabledWallets.d.ts.map +1 -1
- package/dist/browser/index.mjs +377 -343
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +61 -28
- package/src/classes/EnabledWallets.ts +0 -134
- package/src/classes/index.ts +0 -1
- package/src/components/ConnectedAccountsFlexbox.stories.tsx +0 -32
- package/src/components/ConnectedAccountsFlexbox.tsx +0 -43
- package/src/components/index.ts +0 -2
- package/src/components/wallet/dialogs/connect/CheckboxFormControl.tsx +0 -20
- package/src/components/wallet/dialogs/connect/Dialog.tsx +0 -55
- package/src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx +0 -36
- package/src/components/wallet/dialogs/connect/Permissions.tsx +0 -33
- package/src/components/wallet/dialogs/connect/index.ts +0 -2
- package/src/components/wallet/dialogs/index.ts +0 -2
- package/src/components/wallet/dialogs/revoke/Dialog.tsx +0 -44
- package/src/components/wallet/dialogs/revoke/index.ts +0 -1
- package/src/components/wallet/index.ts +0 -3
- package/src/components/wallet/lib/ActiveProvider.ts +0 -7
- package/src/components/wallet/lib/TableHeadData.ts +0 -39
- package/src/components/wallet/lib/index.ts +0 -2
- package/src/components/wallet/table/ConnectedWalletsTable.tsx +0 -62
- package/src/components/wallet/table/ConnectedWalletsTableRow.tsx +0 -77
- package/src/components/wallet/table/cells/Accounts.tsx +0 -26
- package/src/components/wallet/table/cells/Actions.tsx +0 -38
- package/src/components/wallet/table/cells/Cells.tsx +0 -16
- package/src/components/wallet/table/cells/ChainName.tsx +0 -8
- package/src/components/wallet/table/cells/State.tsx +0 -30
- package/src/components/wallet/table/cells/Wallet.tsx +0 -21
- package/src/components/wallet/table/cells/index.ts +0 -6
- package/src/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.tsx +0 -17
- package/src/components/wallet/table/cells/lib/index.ts +0 -1
- package/src/components/wallet/table/hooks/index.ts +0 -1
- package/src/components/wallet/table/hooks/useActiveProviderDialogState.tsx +0 -21
- package/src/components/wallet/table/index.ts +0 -4
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useDetectWallets.tsx +0 -29
- package/src/hooks/useEnabledWallets.tsx +0 -47
- package/src/img/index.ts +0 -2
- package/src/img/xyo-color-logo-text-only.svg +0 -1
- package/src/img/xyo-color-logo.svg +0 -1
- package/src/index.ts +0 -3
- package/src/types/global.d.ts +0 -1
- package/src/types/images.d.ts +0 -5
package/dist/browser/index.mjs
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/classes/EnabledWallets.ts
|
|
5
2
|
var DEFAULT_LOCAL_STORAGE_KEY = "XYO|EnabledWallets";
|
|
6
3
|
var EnabledEthWalletConnections = class {
|
|
7
|
-
static {
|
|
8
|
-
__name(this, "EnabledEthWalletConnections");
|
|
9
|
-
}
|
|
10
4
|
// control whether or not enabled/disabled preferences are persisted (i.e. in localStorage)
|
|
11
5
|
persistPreferences = true;
|
|
12
6
|
// Map of wallet names and their enabled/disabled state
|
|
@@ -31,17 +25,17 @@ var EnabledEthWalletConnections = class {
|
|
|
31
25
|
this.toggleEnabledWallet(rdns, true);
|
|
32
26
|
}
|
|
33
27
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
* Given a new set of wallets, set their enabled state based off previous preferences
|
|
29
|
+
*/
|
|
36
30
|
resetWallets(wallets) {
|
|
37
31
|
const newWallets = {};
|
|
38
|
-
const addWallet =
|
|
32
|
+
const addWallet = ([walletName, wallet]) => {
|
|
39
33
|
newWallets[walletName] = {
|
|
40
34
|
// preserve the existing enabled state
|
|
41
35
|
enabled: walletName in this.enabledWallets ? this.enabledWallets[walletName] : true,
|
|
42
36
|
wallet
|
|
43
37
|
};
|
|
44
|
-
}
|
|
38
|
+
};
|
|
45
39
|
Object.entries(wallets).forEach((wallet) => {
|
|
46
40
|
if (wallet !== void 0) {
|
|
47
41
|
addWallet.bind(this);
|
|
@@ -51,10 +45,7 @@ var EnabledEthWalletConnections = class {
|
|
|
51
45
|
this.emitChange();
|
|
52
46
|
}
|
|
53
47
|
subscribe(listener) {
|
|
54
|
-
this.listeners = [
|
|
55
|
-
...this.listeners,
|
|
56
|
-
listener
|
|
57
|
-
];
|
|
48
|
+
this.listeners = [...this.listeners, listener];
|
|
58
49
|
return () => {
|
|
59
50
|
this.listeners = this.listeners.filter((existingListener) => existingListener !== listener);
|
|
60
51
|
};
|
|
@@ -62,9 +53,7 @@ var EnabledEthWalletConnections = class {
|
|
|
62
53
|
toggleEnabledWallet(rdns, enabled) {
|
|
63
54
|
if (rdns && this.ethWalletsState[rdns]) {
|
|
64
55
|
this.ethWalletsState[rdns].enabled = enabled;
|
|
65
|
-
this.ethWalletsState = {
|
|
66
|
-
...this.ethWalletsState
|
|
67
|
-
};
|
|
56
|
+
this.ethWalletsState = { ...this.ethWalletsState };
|
|
68
57
|
this.emitChange();
|
|
69
58
|
}
|
|
70
59
|
}
|
|
@@ -104,221 +93,236 @@ var EnabledEthWalletConnections = class {
|
|
|
104
93
|
// src/components/ConnectedAccountsFlexbox.tsx
|
|
105
94
|
import { Typography as Typography6, useTheme as useTheme2 } from "@mui/material";
|
|
106
95
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
107
|
-
import React13 from "react";
|
|
108
96
|
|
|
109
97
|
// src/hooks/useDetectWallets.tsx
|
|
110
98
|
import { useWalletDiscovery } from "@xylabs/react-crypto";
|
|
111
99
|
import { useMemo } from "react";
|
|
112
|
-
var sortWallets =
|
|
100
|
+
var sortWallets = (wallets) => {
|
|
113
101
|
const result = [];
|
|
114
102
|
for (const wallet of Object.values(wallets)) {
|
|
115
103
|
if (wallet) {
|
|
116
|
-
if (wallet.allowedAccounts.length > 0)
|
|
117
|
-
|
|
104
|
+
if (wallet.allowedAccounts.length > 0)
|
|
105
|
+
result.unshift(wallet);
|
|
106
|
+
else
|
|
107
|
+
result.push(wallet);
|
|
118
108
|
}
|
|
119
109
|
}
|
|
120
110
|
return result;
|
|
121
|
-
}
|
|
122
|
-
var useDetectedWallets =
|
|
111
|
+
};
|
|
112
|
+
var useDetectedWallets = () => {
|
|
123
113
|
const wallets = useWalletDiscovery();
|
|
124
|
-
const sortedWallets = useMemo(() => sortWallets(wallets), [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
sortedWallets,
|
|
132
|
-
totalConnectedAccounts
|
|
133
|
-
};
|
|
134
|
-
}, "useDetectedWallets");
|
|
114
|
+
const sortedWallets = useMemo(() => sortWallets(wallets), [wallets]);
|
|
115
|
+
const totalConnectedAccounts = useMemo(
|
|
116
|
+
() => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),
|
|
117
|
+
[sortedWallets]
|
|
118
|
+
);
|
|
119
|
+
return { sortedWallets, totalConnectedAccounts };
|
|
120
|
+
};
|
|
135
121
|
|
|
136
122
|
// src/hooks/useEnabledWallets.tsx
|
|
137
123
|
import { useWalletDiscovery as useWalletDiscovery2 } from "@xylabs/react-crypto";
|
|
138
124
|
import { useMemo as useMemo2, useSyncExternalStore } from "react";
|
|
139
|
-
var
|
|
140
|
-
var useEnabledWalletsInner =
|
|
125
|
+
var enabledEthWalletsRef = { current: void 0 };
|
|
126
|
+
var useEnabledWalletsInner = (enabledWalletsRdns) => {
|
|
141
127
|
const discoveredWallets = useWalletDiscovery2();
|
|
142
128
|
const wallets = useMemo2(() => {
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
-
for (const [rdns, enabled] of Object.entries(enabledWalletsRdns ?? {}))
|
|
146
|
-
return
|
|
147
|
-
}, [
|
|
148
|
-
discoveredWallets,
|
|
149
|
-
enabledWalletsRdns
|
|
150
|
-
]);
|
|
129
|
+
if (enabledEthWalletsRef.current === void 0) enabledEthWalletsRef.current = new EnabledEthWalletConnections();
|
|
130
|
+
enabledEthWalletsRef.current.resetWallets(discoveredWallets);
|
|
131
|
+
for (const [rdns, enabled] of Object.entries(enabledWalletsRdns ?? {})) enabledEthWalletsRef.current?.toggleEnabledWallet(rdns, enabled);
|
|
132
|
+
return enabledEthWalletsRef.current;
|
|
133
|
+
}, [discoveredWallets, enabledWalletsRdns]);
|
|
151
134
|
return useSyncExternalStore(wallets.subscribe.bind(wallets), () => wallets.wallets);
|
|
152
|
-
}
|
|
153
|
-
var useEnabledWallets =
|
|
135
|
+
};
|
|
136
|
+
var useEnabledWallets = (enabledWalletsRdns) => {
|
|
154
137
|
const wallets = useEnabledWalletsInner(enabledWalletsRdns);
|
|
155
|
-
const enabledWallets = useMemo2(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
138
|
+
const enabledWallets = useMemo2(
|
|
139
|
+
() => (
|
|
140
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
141
|
+
Object.entries(wallets).reduce((acc, [walletName, wallet]) => {
|
|
142
|
+
if (wallet.enabled) acc[walletName] = wallet;
|
|
143
|
+
return acc;
|
|
144
|
+
}, {})
|
|
145
|
+
),
|
|
146
|
+
[wallets]
|
|
147
|
+
);
|
|
164
148
|
return {
|
|
165
|
-
disableWallet:
|
|
166
|
-
enableWallet:
|
|
149
|
+
disableWallet: enabledEthWalletsRef.current?.disableWallet.bind(enabledEthWalletsRef.current),
|
|
150
|
+
enableWallet: enabledEthWalletsRef.current?.enableWallet.bind(enabledEthWalletsRef.current),
|
|
167
151
|
enabledWallets,
|
|
168
152
|
wallets
|
|
169
153
|
};
|
|
170
|
-
}
|
|
154
|
+
};
|
|
171
155
|
|
|
172
156
|
// src/components/wallet/dialogs/connect/CheckboxFormControl.tsx
|
|
173
|
-
import {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
157
|
+
import {
|
|
158
|
+
Checkbox,
|
|
159
|
+
FormControl,
|
|
160
|
+
FormLabel
|
|
161
|
+
} from "@mui/material";
|
|
162
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
163
|
+
var CheckboxFormControl = ({ onCheckChanged, ...props }) => {
|
|
164
|
+
return /* @__PURE__ */ jsx(FormControl, { ...props, children: /* @__PURE__ */ jsxs(FormLabel, { children: [
|
|
165
|
+
/* @__PURE__ */ jsx(Checkbox, { onChange: (_, checked) => onCheckChanged?.(checked) }),
|
|
166
|
+
"Do not show this again."
|
|
167
|
+
] }) });
|
|
168
|
+
};
|
|
180
169
|
|
|
181
170
|
// src/components/wallet/dialogs/connect/Dialog.tsx
|
|
182
|
-
import {
|
|
183
|
-
|
|
171
|
+
import {
|
|
172
|
+
Button,
|
|
173
|
+
Dialog,
|
|
174
|
+
DialogActions,
|
|
175
|
+
DialogContent,
|
|
176
|
+
DialogTitle
|
|
177
|
+
} from "@mui/material";
|
|
184
178
|
|
|
185
179
|
// src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx
|
|
186
180
|
import { SyncAlt } from "@mui/icons-material";
|
|
187
181
|
import { Typography } from "@mui/material";
|
|
188
182
|
import { ConstrainedImage } from "@xylabs/react-crypto";
|
|
189
183
|
import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
190
|
-
import React2 from "react";
|
|
191
184
|
|
|
192
185
|
// src/img/xyo-color-logo.svg
|
|
193
186
|
var xyo_color_logo_default = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 238"><defs><style>.cls-1{fill:#8d8fc6;}.cls-2{fill:#579fd6;}.cls-3{fill:#f27046;}.cls-4{fill:#eb407a;}</style></defs><path class="cls-1" d="M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z"/><path class="cls-2" d="M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z"/><path class="cls-3" d="M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z"/><path class="cls-4" d="M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z"/></svg>';
|
|
194
187
|
|
|
195
188
|
// src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
}), /* @__PURE__ */ React2.createElement(Typography, {
|
|
224
|
-
variant: "subtitle1"
|
|
225
|
-
}, providerName)));
|
|
226
|
-
}, "LinkedProvidersFlexbox");
|
|
189
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
190
|
+
var LinkedProvidersFlexbox = ({
|
|
191
|
+
icon,
|
|
192
|
+
providerName,
|
|
193
|
+
...props
|
|
194
|
+
}) => {
|
|
195
|
+
return /* @__PURE__ */ jsxs2(FlexRow, { gap: 4, justifyContent: "space-evenly", ...props, children: [
|
|
196
|
+
/* @__PURE__ */ jsxs2(FlexCol, { gap: 0.5, children: [
|
|
197
|
+
/* @__PURE__ */ jsx2("img", { alt: "XYO Logo", src: xyo_color_logo_default, style: { height: "48px" } }),
|
|
198
|
+
/* @__PURE__ */ jsx2(Typography, { variant: "subtitle1", children: "XYO App" })
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ jsx2(SyncAlt, { fontSize: "large" }),
|
|
201
|
+
/* @__PURE__ */ jsxs2(FlexCol, { gap: 0.5, children: [
|
|
202
|
+
/* @__PURE__ */ jsx2(
|
|
203
|
+
ConstrainedImage,
|
|
204
|
+
{
|
|
205
|
+
constrainedValue: "48px",
|
|
206
|
+
src: icon,
|
|
207
|
+
alt: providerName,
|
|
208
|
+
style: { height: "48px", maxWidth: "48px" }
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ jsx2(Typography, { variant: "subtitle1", children: providerName })
|
|
212
|
+
] })
|
|
213
|
+
] });
|
|
214
|
+
};
|
|
227
215
|
|
|
228
216
|
// src/components/wallet/dialogs/connect/Permissions.tsx
|
|
229
217
|
import { Link, Typography as Typography2 } from "@mui/material";
|
|
230
218
|
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
|
231
|
-
import
|
|
232
|
-
var WalletPermissionsFlexbox =
|
|
233
|
-
return /* @__PURE__ */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
219
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
220
|
+
var WalletPermissionsFlexbox = (props) => {
|
|
221
|
+
return /* @__PURE__ */ jsxs3(FlexCol2, { gap: 4, ...props, children: [
|
|
222
|
+
/* @__PURE__ */ jsx3(Typography2, { fontWeight: "bold", sx: { textAlign: "center" }, children: "This will allow XYO to:" }),
|
|
223
|
+
/* @__PURE__ */ jsxs3("ul", { children: [
|
|
224
|
+
/* @__PURE__ */ jsx3("li", { children: "View your wallet account(s) and address(es)" }),
|
|
225
|
+
/* @__PURE__ */ jsx3("li", { children: "Read-only access to browse the public blockchain(s) you select" })
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ jsxs3(Typography2, { variant: "subtitle1", sx: { textAlign: "center" }, children: [
|
|
228
|
+
"You control what accounts to share and what blockchains to view. You can see or revoke access via your wallet's settings at anytime. View more on XYO's sovereign data philosophy",
|
|
229
|
+
" ",
|
|
230
|
+
/* @__PURE__ */ jsx3(
|
|
231
|
+
Link,
|
|
232
|
+
{
|
|
233
|
+
href: "https://cointelegraph.com/innovation-circle/decentralization-and-sovereignty-debunking-our-approach-to-digital-sovereignty",
|
|
234
|
+
sx: { fontWeight: "bold" },
|
|
235
|
+
target: "_blank",
|
|
236
|
+
children: "here"
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
"."
|
|
240
|
+
] })
|
|
241
|
+
] });
|
|
242
|
+
};
|
|
254
243
|
|
|
255
244
|
// src/components/wallet/dialogs/connect/Dialog.tsx
|
|
256
|
-
|
|
245
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
246
|
+
var ConnectWalletDialog = ({
|
|
247
|
+
activeProvider,
|
|
248
|
+
onIgnoreConnectDialog,
|
|
249
|
+
...props
|
|
250
|
+
}) => {
|
|
257
251
|
const { icon, providerName } = activeProvider ?? {};
|
|
258
|
-
const onConnect =
|
|
252
|
+
const onConnect = async () => {
|
|
259
253
|
try {
|
|
260
254
|
await activeProvider?.connectWallet?.();
|
|
261
255
|
props.onClose?.({}, "escapeKeyDown");
|
|
262
256
|
} catch (e) {
|
|
263
257
|
console.warn(`Error connecting to wallet: ${e.message}`);
|
|
264
258
|
}
|
|
265
|
-
}
|
|
266
|
-
return /* @__PURE__ */
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
259
|
+
};
|
|
260
|
+
return /* @__PURE__ */ jsxs4(
|
|
261
|
+
Dialog,
|
|
262
|
+
{
|
|
263
|
+
slotProps: { paper: { sx: { display: "flex", gap: 4 } } },
|
|
264
|
+
...props,
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ jsx4(DialogTitle, { sx: { textAlign: "center" }, children: "XYO Wants To Access The Blockchain on Your Behalf" }),
|
|
267
|
+
/* @__PURE__ */ jsxs4(
|
|
268
|
+
DialogContent,
|
|
269
|
+
{
|
|
270
|
+
sx: {
|
|
271
|
+
display: "flex",
|
|
272
|
+
flexDirection: "column",
|
|
273
|
+
gap: 4
|
|
274
|
+
},
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ jsx4(LinkedProvidersFlexbox, { icon, providerName }),
|
|
277
|
+
/* @__PURE__ */ jsx4(WalletPermissionsFlexbox, {}),
|
|
278
|
+
/* @__PURE__ */ jsx4(CheckboxFormControl, { onCheckChanged: onIgnoreConnectDialog })
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
/* @__PURE__ */ jsxs4(DialogActions, { children: [
|
|
283
|
+
/* @__PURE__ */ jsx4(Button, { variant: "outlined", onClick: () => props.onClose?.({}, "escapeKeyDown"), children: "Close" }),
|
|
284
|
+
/* @__PURE__ */ jsx4(Button, { variant: "contained", onClick: onConnect, children: "Connect" })
|
|
285
|
+
] })
|
|
286
|
+
]
|
|
285
287
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
providerName
|
|
289
|
-
}), /* @__PURE__ */ React4.createElement(WalletPermissionsFlexbox, null), /* @__PURE__ */ React4.createElement(CheckboxFormControl, {
|
|
290
|
-
onCheckChanged: onIgnoreConnectDialog
|
|
291
|
-
})), /* @__PURE__ */ React4.createElement(DialogActions, null, /* @__PURE__ */ React4.createElement(Button, {
|
|
292
|
-
variant: "outlined",
|
|
293
|
-
onClick: /* @__PURE__ */ __name(() => props.onClose?.({}, "escapeKeyDown"), "onClick")
|
|
294
|
-
}, "Close"), /* @__PURE__ */ React4.createElement(Button, {
|
|
295
|
-
variant: "contained",
|
|
296
|
-
onClick: onConnect
|
|
297
|
-
}, "Connect")));
|
|
298
|
-
}, "ConnectWalletDialog");
|
|
288
|
+
);
|
|
289
|
+
};
|
|
299
290
|
|
|
300
291
|
// src/components/wallet/dialogs/revoke/Dialog.tsx
|
|
301
|
-
import {
|
|
292
|
+
import {
|
|
293
|
+
Button as Button2,
|
|
294
|
+
Dialog as Dialog2,
|
|
295
|
+
DialogActions as DialogActions2,
|
|
296
|
+
DialogContent as DialogContent2,
|
|
297
|
+
DialogTitle as DialogTitle2,
|
|
298
|
+
Typography as Typography3
|
|
299
|
+
} from "@mui/material";
|
|
302
300
|
import { ConstrainedImage as ConstrainedImage2 } from "@xylabs/react-crypto";
|
|
303
301
|
import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
304
|
-
import
|
|
305
|
-
var RevokeWalletConnectionDialog =
|
|
306
|
-
return /* @__PURE__ */
|
|
307
|
-
gap: 2,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
302
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
303
|
+
var RevokeWalletConnectionDialog = ({ activeProvider, ...props }) => {
|
|
304
|
+
return /* @__PURE__ */ jsxs5(Dialog2, { ...props, children: [
|
|
305
|
+
/* @__PURE__ */ jsxs5(FlexRow2, { gap: 2, justifyContent: "start", pl: 2, children: [
|
|
306
|
+
/* @__PURE__ */ jsx5(ConstrainedImage2, { src: activeProvider?.icon, constrainedValue: "24px" }),
|
|
307
|
+
/* @__PURE__ */ jsxs5(DialogTitle2, { sx: { pl: 0 }, children: [
|
|
308
|
+
"Revoke",
|
|
309
|
+
activeProvider?.providerName,
|
|
310
|
+
" ",
|
|
311
|
+
"Access"
|
|
312
|
+
] })
|
|
313
|
+
] }),
|
|
314
|
+
/* @__PURE__ */ jsxs5(DialogContent2, { children: [
|
|
315
|
+
/* @__PURE__ */ jsxs5(Typography3, { children: [
|
|
316
|
+
"Revoking access to your wallet must be done from the wallet's browser extension. Wallets grant access to specific domains please consult",
|
|
317
|
+
" ",
|
|
318
|
+
activeProvider?.providerName,
|
|
319
|
+
"'s documentation on how to revoke access to this website:"
|
|
320
|
+
] }),
|
|
321
|
+
/* @__PURE__ */ jsx5(Typography3, { children: globalThis.location.origin })
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ jsx5(DialogActions2, { children: /* @__PURE__ */ jsx5(Button2, { variant: "contained", onClick: () => props.onClose?.({}, "escapeKeyDown"), children: "Close" }) })
|
|
324
|
+
] });
|
|
325
|
+
};
|
|
322
326
|
|
|
323
327
|
// src/components/wallet/lib/TableHeadData.ts
|
|
324
328
|
var WalletsTableHeadCells = [
|
|
@@ -360,89 +364,101 @@ var WalletsTableHeadCells = [
|
|
|
360
364
|
];
|
|
361
365
|
|
|
362
366
|
// src/components/wallet/table/cells/Accounts.tsx
|
|
363
|
-
import {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
367
|
+
import {
|
|
368
|
+
TableCell,
|
|
369
|
+
Tooltip,
|
|
370
|
+
Typography as Typography4
|
|
371
|
+
} from "@mui/material";
|
|
372
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
373
|
+
var ConnectedWalletsAccountsTableCell = ({
|
|
374
|
+
additionalAccounts,
|
|
375
|
+
currentAccount,
|
|
376
|
+
totalAccounts,
|
|
377
|
+
tableCellProps
|
|
378
|
+
}) => {
|
|
379
|
+
return /* @__PURE__ */ jsx6(TableCell, { ...tableCellProps, children: /* @__PURE__ */ jsx6(
|
|
380
|
+
Tooltip,
|
|
381
|
+
{
|
|
382
|
+
sx: { cursor: totalAccounts > 0 ? "pointer" : "auto" },
|
|
383
|
+
title: [...currentAccount ?? [], ...additionalAccounts ?? []].map((address) => /* @__PURE__ */ jsx6("p", { children: address }, address)),
|
|
384
|
+
children: /* @__PURE__ */ jsx6(Typography4, { children: totalAccounts })
|
|
385
|
+
}
|
|
386
|
+
) });
|
|
387
|
+
};
|
|
378
388
|
|
|
379
389
|
// src/components/wallet/table/cells/Actions.tsx
|
|
380
390
|
import { Check, InfoOutlined } from "@mui/icons-material";
|
|
381
|
-
import {
|
|
391
|
+
import {
|
|
392
|
+
Button as Button3,
|
|
393
|
+
IconButton,
|
|
394
|
+
TableCell as TableCell2,
|
|
395
|
+
Typography as Typography5
|
|
396
|
+
} from "@mui/material";
|
|
382
397
|
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
383
|
-
import
|
|
384
|
-
var ConnectedWalletsActionsTableCell =
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
variant: "contained",
|
|
395
|
-
onClick:
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
}, /* @__PURE__ */ React7.createElement(InfoOutlined, null)) : null));
|
|
399
|
-
}, "ConnectedWalletsActionsTableCell");
|
|
398
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
399
|
+
var ConnectedWalletsActionsTableCell = ({
|
|
400
|
+
connected,
|
|
401
|
+
onConnect,
|
|
402
|
+
onRevoke,
|
|
403
|
+
tableCellProps
|
|
404
|
+
}) => {
|
|
405
|
+
return /* @__PURE__ */ jsx7(TableCell2, { ...tableCellProps, children: /* @__PURE__ */ jsxs6(FlexRow3, { gap: 2, justifyContent: "start", children: [
|
|
406
|
+
connected ? /* @__PURE__ */ jsxs6(Typography5, { sx: { display: "inline-flex", gap: 0.5 }, children: [
|
|
407
|
+
/* @__PURE__ */ jsx7(Check, {}),
|
|
408
|
+
"Connected"
|
|
409
|
+
] }) : /* @__PURE__ */ jsx7(Button3, { variant: "contained", onClick: onConnect, children: "Connect" }),
|
|
410
|
+
connected ? /* @__PURE__ */ jsx7(IconButton, { onClick: onRevoke, children: /* @__PURE__ */ jsx7(InfoOutlined, {}) }) : null
|
|
411
|
+
] }) });
|
|
412
|
+
};
|
|
400
413
|
|
|
401
414
|
// src/components/wallet/table/cells/ChainName.tsx
|
|
402
415
|
import { TableCell as TableCell3 } from "@mui/material";
|
|
403
|
-
import
|
|
404
|
-
var ConnectedWalletsChainNameTableCell =
|
|
405
|
-
return /* @__PURE__ */
|
|
406
|
-
}
|
|
416
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
417
|
+
var ConnectedWalletsChainNameTableCell = ({ chainName, tableCellProps }) => {
|
|
418
|
+
return /* @__PURE__ */ jsx8(TableCell3, { ...tableCellProps, children: chainName });
|
|
419
|
+
};
|
|
407
420
|
|
|
408
421
|
// src/components/wallet/table/cells/State.tsx
|
|
409
422
|
import { Switch, TableCell as TableCell4 } from "@mui/material";
|
|
410
423
|
import { isDefined } from "@xylabs/sdk-js";
|
|
411
|
-
import
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
const
|
|
424
|
+
import { useMemo as useMemo3 } from "react";
|
|
425
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
426
|
+
var ConnectedWalletState = ({
|
|
427
|
+
connected,
|
|
428
|
+
walletRdns,
|
|
429
|
+
tableCellProps
|
|
430
|
+
}) => {
|
|
431
|
+
const {
|
|
432
|
+
disableWallet,
|
|
433
|
+
enableWallet,
|
|
434
|
+
wallets
|
|
435
|
+
} = useEnabledWallets();
|
|
436
|
+
const enabled = useMemo3(() => isDefined(walletRdns) ? wallets[walletRdns]?.enabled : false, [wallets, walletRdns]);
|
|
437
|
+
const handleClick = (event) => {
|
|
419
438
|
const checked = event.target?.checked;
|
|
420
439
|
if (isDefined(walletRdns)) {
|
|
421
440
|
checked ? enableWallet?.(walletRdns) : disableWallet?.(walletRdns);
|
|
422
441
|
}
|
|
423
|
-
}
|
|
424
|
-
return /* @__PURE__ */
|
|
425
|
-
|
|
426
|
-
checked: connected && enabled,
|
|
427
|
-
onChange: handleClick
|
|
428
|
-
}));
|
|
429
|
-
}, "ConnectedWalletState");
|
|
442
|
+
};
|
|
443
|
+
return /* @__PURE__ */ jsx9(TableCell4, { ...tableCellProps, children: /* @__PURE__ */ jsx9(Switch, { disabled: !connected, checked: connected && enabled, onChange: handleClick }) });
|
|
444
|
+
};
|
|
430
445
|
|
|
431
446
|
// src/components/wallet/table/cells/Wallet.tsx
|
|
432
447
|
import { TableCell as TableCell5, useTheme } from "@mui/material";
|
|
433
448
|
import { ConstrainedImage as ConstrainedImage3 } from "@xylabs/react-crypto";
|
|
434
449
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
435
|
-
import
|
|
436
|
-
var ConnectedWalletsWalletTableCell =
|
|
450
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
451
|
+
var ConnectedWalletsWalletTableCell = ({
|
|
452
|
+
icon,
|
|
453
|
+
walletName,
|
|
454
|
+
tableCellProps
|
|
455
|
+
}) => {
|
|
437
456
|
const theme = useTheme();
|
|
438
|
-
return /* @__PURE__ */
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
src: icon
|
|
444
|
-
}), walletName));
|
|
445
|
-
}, "ConnectedWalletsWalletTableCell");
|
|
457
|
+
return /* @__PURE__ */ jsx10(TableCell5, { ...tableCellProps, children: /* @__PURE__ */ jsxs7(FlexRow4, { gap: 2, justifyContent: "start", children: [
|
|
458
|
+
/* @__PURE__ */ jsx10(ConstrainedImage3, { constrainedValue: theme.spacing(4), src: icon }),
|
|
459
|
+
walletName
|
|
460
|
+
] }) });
|
|
461
|
+
};
|
|
446
462
|
|
|
447
463
|
// src/components/wallet/table/cells/Cells.tsx
|
|
448
464
|
var ConnectedWalletTableCells = [
|
|
@@ -454,145 +470,163 @@ var ConnectedWalletTableCells = [
|
|
|
454
470
|
];
|
|
455
471
|
|
|
456
472
|
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
|
457
|
-
import {
|
|
458
|
-
|
|
473
|
+
import {
|
|
474
|
+
Table,
|
|
475
|
+
TableBody,
|
|
476
|
+
TableCell as TableCell6,
|
|
477
|
+
TableHead,
|
|
478
|
+
TableRow as TableRow2
|
|
479
|
+
} from "@mui/material";
|
|
480
|
+
import { useState as useState2 } from "react";
|
|
459
481
|
|
|
460
482
|
// src/components/wallet/table/ConnectedWalletsTableRow.tsx
|
|
461
483
|
import { TableRow } from "@mui/material";
|
|
462
484
|
import { useEthWallet } from "@xylabs/react-crypto";
|
|
463
|
-
import
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
485
|
+
import { useCallback, useMemo as useMemo4 } from "react";
|
|
486
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
487
|
+
var WalletConnectionsTableRow = ({
|
|
488
|
+
ignoreConnectDialog,
|
|
489
|
+
onConnectClick,
|
|
490
|
+
onRevoke,
|
|
491
|
+
wallet,
|
|
492
|
+
...props
|
|
493
|
+
}) => {
|
|
494
|
+
const {
|
|
495
|
+
currentAccount: currentAccountFromWallet,
|
|
496
|
+
additionalAccounts,
|
|
497
|
+
chainName,
|
|
498
|
+
connectWallet,
|
|
499
|
+
providerInfo
|
|
500
|
+
} = useEthWallet(wallet);
|
|
501
|
+
const currentAccount = currentAccountFromWallet?.toString() ? [currentAccountFromWallet.toString()] : [];
|
|
469
502
|
const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0);
|
|
470
503
|
const connected = !!currentAccount?.length;
|
|
471
|
-
const {
|
|
504
|
+
const {
|
|
505
|
+
icon,
|
|
506
|
+
name,
|
|
507
|
+
rdns
|
|
508
|
+
} = useMemo4(() => providerInfo ?? {
|
|
472
509
|
icon: void 0,
|
|
473
510
|
name: void 0,
|
|
474
511
|
rdns: void 0
|
|
475
|
-
}, [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
icon,
|
|
485
|
-
name
|
|
486
|
-
]);
|
|
512
|
+
}, [providerInfo]);
|
|
513
|
+
const activeProvider = useMemo4(
|
|
514
|
+
() => ({
|
|
515
|
+
connectWallet,
|
|
516
|
+
icon,
|
|
517
|
+
providerName: name
|
|
518
|
+
}),
|
|
519
|
+
[connectWallet, icon, name]
|
|
520
|
+
);
|
|
487
521
|
const onRevokeLocal = useCallback(() => {
|
|
488
522
|
onRevoke?.(activeProvider);
|
|
489
|
-
}, [
|
|
490
|
-
activeProvider,
|
|
491
|
-
onRevoke
|
|
492
|
-
]);
|
|
523
|
+
}, [activeProvider, onRevoke]);
|
|
493
524
|
const onConnectLocal = useCallback(async () => {
|
|
494
525
|
if (ignoreConnectDialog) {
|
|
495
526
|
await connectWallet?.();
|
|
496
527
|
} else {
|
|
497
528
|
onConnectClick?.(activeProvider);
|
|
498
529
|
}
|
|
499
|
-
}, [
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
})));
|
|
518
|
-
}, "WalletConnectionsTableRow");
|
|
530
|
+
}, [activeProvider, connectWallet, ignoreConnectDialog, onConnectClick]);
|
|
531
|
+
return /* @__PURE__ */ jsx11(TableRow, { ...props, children: Object.entries(ConnectedWalletTableCells).map(([cellName, Cell]) => /* @__PURE__ */ jsx11(
|
|
532
|
+
Cell,
|
|
533
|
+
{
|
|
534
|
+
additionalAccounts,
|
|
535
|
+
chainName,
|
|
536
|
+
connected,
|
|
537
|
+
currentAccount,
|
|
538
|
+
icon,
|
|
539
|
+
onConnect: onConnectLocal,
|
|
540
|
+
onRevoke: onRevokeLocal,
|
|
541
|
+
totalAccounts,
|
|
542
|
+
walletName: name,
|
|
543
|
+
walletRdns: rdns
|
|
544
|
+
},
|
|
545
|
+
cellName
|
|
546
|
+
)) });
|
|
547
|
+
};
|
|
519
548
|
|
|
520
549
|
// src/components/wallet/table/hooks/useActiveProviderDialogState.tsx
|
|
521
550
|
import { useState } from "react";
|
|
522
|
-
var useActiveProviderDialogState =
|
|
551
|
+
var useActiveProviderDialogState = (setActiveProvider) => {
|
|
523
552
|
const [show, setShow] = useState(false);
|
|
524
|
-
const onSetActiveProvider =
|
|
553
|
+
const onSetActiveProvider = (activeProvider) => {
|
|
525
554
|
setShow(true);
|
|
526
555
|
setActiveProvider(activeProvider);
|
|
527
|
-
}
|
|
528
|
-
const onClose =
|
|
556
|
+
};
|
|
557
|
+
const onClose = () => {
|
|
529
558
|
setShow(false);
|
|
530
559
|
setActiveProvider({});
|
|
531
|
-
}
|
|
532
|
-
return [
|
|
533
|
-
|
|
534
|
-
onSetActiveProvider,
|
|
535
|
-
onClose
|
|
536
|
-
];
|
|
537
|
-
}, "useActiveProviderDialogState");
|
|
560
|
+
};
|
|
561
|
+
return [show, onSetActiveProvider, onClose];
|
|
562
|
+
};
|
|
538
563
|
|
|
539
564
|
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
|
540
|
-
|
|
565
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
566
|
+
var ConnectedWalletsTable = ({
|
|
567
|
+
ignoreConnectDialog,
|
|
568
|
+
onIgnoreConnectDialog,
|
|
569
|
+
wallets,
|
|
570
|
+
...props
|
|
571
|
+
}) => {
|
|
541
572
|
const [activeProvider, setActiveProvider] = useState2();
|
|
542
573
|
const [showConnect, onSetActiveProviderConnect, onConnectClose] = useActiveProviderDialogState(setActiveProvider);
|
|
543
574
|
const [showRevoke, onSetActiveProviderRevoke, onRevokeClose] = useActiveProviderDialogState(setActiveProvider);
|
|
544
|
-
return /* @__PURE__ */
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
575
|
+
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
576
|
+
/* @__PURE__ */ jsxs8(Table, { ...props, children: [
|
|
577
|
+
/* @__PURE__ */ jsx12(TableHead, { children: /* @__PURE__ */ jsx12(TableRow2, { children: WalletsTableHeadCells.map(({
|
|
578
|
+
disablePadding,
|
|
579
|
+
id,
|
|
580
|
+
label,
|
|
581
|
+
align,
|
|
582
|
+
width
|
|
583
|
+
}) => /* @__PURE__ */ jsx12(TableCell6, { align, padding: disablePadding ? "none" : "normal", width: width ?? "auto", children: label }, id)) }) }),
|
|
584
|
+
/* @__PURE__ */ jsx12(TableBody, { children: (wallets ?? []).map((wallet) => /* @__PURE__ */ jsx12(
|
|
585
|
+
WalletConnectionsTableRow,
|
|
586
|
+
{
|
|
587
|
+
ignoreConnectDialog,
|
|
588
|
+
onConnectClick: onSetActiveProviderConnect,
|
|
589
|
+
onRevoke: onSetActiveProviderRevoke,
|
|
590
|
+
wallet
|
|
591
|
+
},
|
|
592
|
+
wallet.providerInfo?.rdns
|
|
593
|
+
)) })
|
|
594
|
+
] }),
|
|
595
|
+
/* @__PURE__ */ jsx12(RevokeWalletConnectionDialog, { open: showRevoke, onClose: onRevokeClose, activeProvider }),
|
|
596
|
+
/* @__PURE__ */ jsx12(
|
|
597
|
+
ConnectWalletDialog,
|
|
598
|
+
{
|
|
599
|
+
activeProvider,
|
|
600
|
+
onClose: onConnectClose,
|
|
601
|
+
open: showConnect,
|
|
602
|
+
onIgnoreConnectDialog
|
|
603
|
+
}
|
|
604
|
+
)
|
|
605
|
+
] });
|
|
606
|
+
};
|
|
566
607
|
|
|
567
608
|
// src/components/ConnectedAccountsFlexbox.tsx
|
|
568
|
-
|
|
609
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
610
|
+
var ConnectedAccountsFlexbox = ({
|
|
611
|
+
ref,
|
|
612
|
+
ignoreConnectDialog,
|
|
613
|
+
onIgnoreConnectDialog,
|
|
614
|
+
...props
|
|
615
|
+
}) => {
|
|
569
616
|
const theme = useTheme2();
|
|
570
617
|
const { totalConnectedAccounts, sortedWallets } = useDetectedWallets();
|
|
571
|
-
return /* @__PURE__ */
|
|
572
|
-
alignItems: "
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
}, "Detected Web3 Wallets"), totalConnectedAccounts ? /* @__PURE__ */ React13.createElement(Typography6, {
|
|
585
|
-
variant: "subtitle1",
|
|
586
|
-
color: theme.vars.palette.secondary.main,
|
|
587
|
-
sx: {
|
|
588
|
-
opacity: 0.5
|
|
589
|
-
}
|
|
590
|
-
}, "Total Connected Accounts:", " ", totalConnectedAccounts) : null), /* @__PURE__ */ React13.createElement(ConnectedWalletsTable, {
|
|
591
|
-
wallets: sortedWallets,
|
|
592
|
-
ignoreConnectDialog,
|
|
593
|
-
onIgnoreConnectDialog
|
|
594
|
-
}));
|
|
595
|
-
}, "ConnectedAccountsFlexbox");
|
|
618
|
+
return /* @__PURE__ */ jsxs9(FlexCol3, { alignItems: "stretch", justifyContent: "start", gap: 2, ref, ...props, children: [
|
|
619
|
+
/* @__PURE__ */ jsxs9(FlexCol3, { alignItems: "start", children: [
|
|
620
|
+
/* @__PURE__ */ jsx13(Typography6, { variant: "h2", sx: { mb: 0.5 }, children: "Detected Web3 Wallets" }),
|
|
621
|
+
totalConnectedAccounts ? /* @__PURE__ */ jsxs9(Typography6, { variant: "subtitle1", color: theme.vars.palette.secondary.main, sx: { opacity: 0.5 }, children: [
|
|
622
|
+
"Total Connected Accounts:",
|
|
623
|
+
" ",
|
|
624
|
+
totalConnectedAccounts
|
|
625
|
+
] }) : null
|
|
626
|
+
] }),
|
|
627
|
+
/* @__PURE__ */ jsx13(ConnectedWalletsTable, { wallets: sortedWallets, ignoreConnectDialog, onIgnoreConnectDialog })
|
|
628
|
+
] });
|
|
629
|
+
};
|
|
596
630
|
ConnectedAccountsFlexbox.displayName = "ConnectedAccountsFlexbox";
|
|
597
631
|
export {
|
|
598
632
|
CheckboxFormControl,
|