@matchain/matchid-sdk-react 0.1.56-alpha.16 → 0.1.56-alpha.18
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/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +152 -87
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +4 -3
- package/dist/chains.mjs +2 -1
- package/dist/chunk-3CR66BEX.mjs +19 -0
- package/dist/chunk-3CR66BEX.mjs.map +1 -0
- package/dist/{chunk-FQ6PYZPD.mjs → chunk-7SUDHG7S.mjs} +1 -1
- package/dist/chunk-7SUDHG7S.mjs.map +1 -0
- package/dist/{chunk-O2D3TKRD.mjs → chunk-EUG3QRAG.mjs} +2 -2
- package/dist/{chunk-HYQ3T6WW.mjs → chunk-JX73EY6V.mjs} +2 -14
- package/dist/chunk-JX73EY6V.mjs.map +1 -0
- package/dist/{chunk-LADAY3IL.mjs → chunk-QMV4FDUH.mjs} +375 -352
- package/dist/chunk-QMV4FDUH.mjs.map +1 -0
- package/dist/components.d.mts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +473 -401
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +3 -2
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +172 -109
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +3 -2
- package/dist/icon.d.mts +2 -2
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js.map +1 -1
- package/dist/icon.mjs +1 -1
- package/dist/{index-DCyE39bg.d.mts → index-84CqVi2I.d.mts} +1 -1
- package/dist/{index-BINNnZNA.d.ts → index-B70k4Jpk.d.ts} +1 -2
- package/dist/{index-BIVGhRja.d.mts → index-BJJ0Gb6v.d.mts} +1 -2
- package/dist/{index-BXhXRggh.d.ts → index-BNqdFiOo.d.ts} +1 -1
- package/dist/{index-DGsB7f2H.d.ts → index-BctnHnJp.d.ts} +1 -1
- package/dist/{index-DuCefmJ0.d.mts → index-BqI0PEIi.d.mts} +1 -1
- package/dist/{index-DZpXCByF.d.ts → index-C2hr7zlN.d.ts} +5 -3
- package/dist/{index-CqHlL6ue.d.mts → index-CTHpnEoB.d.mts} +5 -3
- package/dist/{index-De8efmdb.d.mts → index-Car1jFyN.d.mts} +1 -1
- package/dist/{index-CpJtux-G.d.ts → index-CcVHENNv.d.ts} +1 -1
- package/dist/{index-DQYg6bEA.d.ts → index-Cqdz_5bE.d.ts} +2 -2
- package/dist/{index-m2bn_W3Y.d.ts → index-CvzpMw3N.d.ts} +1 -1
- package/dist/{index-CzCkxwOm.d.mts → index-DkijpM5Q.d.mts} +1 -1
- package/dist/{index-BLjGmf9p.d.mts → index-DxHhOW24.d.mts} +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.mts +42 -38
- package/dist/index.d.ts +42 -38
- package/dist/index.js +256 -235
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/{types-C8FLH1yn.d.mts → types-BrVeC0c8.d.mts} +0 -1
- package/dist/{types-C8FLH1yn.d.ts → types-BrVeC0c8.d.ts} +0 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/ui.d.mts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +144 -75
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +3 -2
- package/example/package-lock.json +2965 -0
- package/example/package.json +2 -1
- package/example/src/App.tsx +8 -3
- package/example/src/config/index.ts +2 -2
- package/example/src/pages/Home.tsx +15 -15
- package/example/src/pages/Wallet/index.tsx +2 -4
- package/example/src/store/useLocalStore.ts +19 -19
- package/example/yarn.lock +559 -548
- package/package.json +4 -9
- package/dist/chunk-FQ6PYZPD.mjs.map +0 -1
- package/dist/chunk-HYQ3T6WW.mjs.map +0 -1
- package/dist/chunk-LADAY3IL.mjs.map +0 -1
- /package/dist/{chunk-O2D3TKRD.mjs.map → chunk-EUG3QRAG.mjs.map} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
matchMain,
|
|
3
|
+
matchTest
|
|
4
|
+
} from "./chunk-JX73EY6V.mjs";
|
|
1
5
|
import {
|
|
2
6
|
NumberFormatter,
|
|
3
7
|
bytesToBase64,
|
|
@@ -64,7 +68,7 @@ import {
|
|
|
64
68
|
XIcon,
|
|
65
69
|
XverseIcon,
|
|
66
70
|
YoutubeIcon
|
|
67
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-7SUDHG7S.mjs";
|
|
68
72
|
import {
|
|
69
73
|
confirm_default,
|
|
70
74
|
connecting_default,
|
|
@@ -2999,7 +3003,7 @@ var useWalletModalStore = create5((set) => ({
|
|
|
2999
3003
|
}));
|
|
3000
3004
|
var useEmailModalStore = create5((set) => ({
|
|
3001
3005
|
isOpen: false,
|
|
3002
|
-
type: "
|
|
3006
|
+
type: "",
|
|
3003
3007
|
open: (type) => set({ isOpen: true, type }),
|
|
3004
3008
|
close: () => set({ isOpen: false })
|
|
3005
3009
|
}));
|
|
@@ -3119,7 +3123,25 @@ function CEXBindModal({
|
|
|
3119
3123
|
|
|
3120
3124
|
// src/context/BusinessProvider.tsx
|
|
3121
3125
|
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
3122
|
-
|
|
3126
|
+
|
|
3127
|
+
// src/components/BindEmailModal/index.tsx
|
|
3128
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3129
|
+
var BindEmailModal = ({ isOpen, onClose, onBack, onLogin }) => {
|
|
3130
|
+
return /* @__PURE__ */ jsx25(
|
|
3131
|
+
EmailModal,
|
|
3132
|
+
{
|
|
3133
|
+
type: "bind",
|
|
3134
|
+
isOpen,
|
|
3135
|
+
onClose,
|
|
3136
|
+
onBack,
|
|
3137
|
+
onLogin
|
|
3138
|
+
}
|
|
3139
|
+
);
|
|
3140
|
+
};
|
|
3141
|
+
var BindEmailModal_default = BindEmailModal;
|
|
3142
|
+
|
|
3143
|
+
// src/context/BusinessProvider.tsx
|
|
3144
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3123
3145
|
function BusinessProvider({ children }) {
|
|
3124
3146
|
const { overview, token } = useUserInfo();
|
|
3125
3147
|
const { type: EVMType, isOpen: EVMIsOpen, close: EVMClose } = useEVMModalStore();
|
|
@@ -3127,8 +3149,8 @@ function BusinessProvider({ children }) {
|
|
|
3127
3149
|
const { type: TRONType, isOpen: TRONIsOpen, close: TRONClose } = useTRONModalStore();
|
|
3128
3150
|
const { type: BTCType, isOpen: BTCIsOpen, close: BTCClose } = useBTCModalStore();
|
|
3129
3151
|
const { type: CEXType, isOpen: CEXIsOpen, close: CEXClose } = useCEXBindModalStore();
|
|
3152
|
+
const { type: EmailType, isOpen: EmailIsOpen, close: EmailClose } = useEmailModalStore();
|
|
3130
3153
|
const WalletModalStore = useWalletModalStore();
|
|
3131
|
-
const EmailModalStore = useEmailModalStore();
|
|
3132
3154
|
const { tgAppAuthCode, setTgAppAuthCode } = useStore_default();
|
|
3133
3155
|
const { login } = useMatch();
|
|
3134
3156
|
const walletModalClose = (func) => {
|
|
@@ -3155,7 +3177,7 @@ function BusinessProvider({ children }) {
|
|
|
3155
3177
|
refetchInterval: 1e3 * 5
|
|
3156
3178
|
});
|
|
3157
3179
|
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
3158
|
-
/* @__PURE__ */
|
|
3180
|
+
/* @__PURE__ */ jsx26(
|
|
3159
3181
|
EVMModal,
|
|
3160
3182
|
{
|
|
3161
3183
|
isOpen: EVMIsOpen && (EVMType == "login" && !overview && !token || EVMType == "bind" && !!token && !!overview),
|
|
@@ -3165,7 +3187,7 @@ function BusinessProvider({ children }) {
|
|
|
3165
3187
|
zIndex: 199
|
|
3166
3188
|
}
|
|
3167
3189
|
),
|
|
3168
|
-
/* @__PURE__ */
|
|
3190
|
+
/* @__PURE__ */ jsx26(
|
|
3169
3191
|
TRONModal,
|
|
3170
3192
|
{
|
|
3171
3193
|
isOpen: TRONIsOpen && (TRONType == "login" && !overview && !token || TRONType == "bind" && !!token && !!overview),
|
|
@@ -3175,7 +3197,7 @@ function BusinessProvider({ children }) {
|
|
|
3175
3197
|
zIndex: 199
|
|
3176
3198
|
}
|
|
3177
3199
|
),
|
|
3178
|
-
/* @__PURE__ */
|
|
3200
|
+
/* @__PURE__ */ jsx26(
|
|
3179
3201
|
TONModal,
|
|
3180
3202
|
{
|
|
3181
3203
|
isOpen: TONIsOpen && (TONType == "login" && !overview && !token || TONType == "bind" && !!token && !!overview),
|
|
@@ -3185,7 +3207,7 @@ function BusinessProvider({ children }) {
|
|
|
3185
3207
|
zIndex: 199
|
|
3186
3208
|
}
|
|
3187
3209
|
),
|
|
3188
|
-
/* @__PURE__ */
|
|
3210
|
+
/* @__PURE__ */ jsx26(
|
|
3189
3211
|
BTCModal,
|
|
3190
3212
|
{
|
|
3191
3213
|
isOpen: BTCIsOpen && (BTCType == "login" && !overview && !token || BTCType == "bind" && !!token && !!overview),
|
|
@@ -3195,7 +3217,7 @@ function BusinessProvider({ children }) {
|
|
|
3195
3217
|
zIndex: 199
|
|
3196
3218
|
}
|
|
3197
3219
|
),
|
|
3198
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ jsx26(
|
|
3199
3221
|
CEXBindModal,
|
|
3200
3222
|
{
|
|
3201
3223
|
isOpen: CEXIsOpen && (!!token && !!overview),
|
|
@@ -3204,7 +3226,7 @@ function BusinessProvider({ children }) {
|
|
|
3204
3226
|
zIndex: 199
|
|
3205
3227
|
}
|
|
3206
3228
|
),
|
|
3207
|
-
/* @__PURE__ */
|
|
3229
|
+
/* @__PURE__ */ jsx26(
|
|
3208
3230
|
WalletModal,
|
|
3209
3231
|
{
|
|
3210
3232
|
isOpen: WalletModalStore.isOpen && (WalletModalStore.type == "login" && !overview && !token || WalletModalStore.type == "bind" && !!token && !!overview),
|
|
@@ -3214,14 +3236,12 @@ function BusinessProvider({ children }) {
|
|
|
3214
3236
|
zIndex: 150
|
|
3215
3237
|
}
|
|
3216
3238
|
),
|
|
3217
|
-
/* @__PURE__ */
|
|
3218
|
-
|
|
3239
|
+
/* @__PURE__ */ jsx26(
|
|
3240
|
+
BindEmailModal_default,
|
|
3219
3241
|
{
|
|
3220
|
-
isOpen:
|
|
3221
|
-
onClose:
|
|
3222
|
-
onLogin:
|
|
3223
|
-
type: EmailModalStore.type,
|
|
3224
|
-
zIndex: 199
|
|
3242
|
+
isOpen: EmailIsOpen && (EmailType == "bind" && !!token && !!overview),
|
|
3243
|
+
onClose: EmailClose,
|
|
3244
|
+
onLogin: EmailClose
|
|
3225
3245
|
}
|
|
3226
3246
|
),
|
|
3227
3247
|
children
|
|
@@ -3229,9 +3249,9 @@ function BusinessProvider({ children }) {
|
|
|
3229
3249
|
}
|
|
3230
3250
|
|
|
3231
3251
|
// src/context/index.tsx
|
|
3232
|
-
import { jsx as
|
|
3252
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3233
3253
|
var Providers = ({ children }) => {
|
|
3234
|
-
return /* @__PURE__ */
|
|
3254
|
+
return /* @__PURE__ */ jsx27(ToastProvider, { children: /* @__PURE__ */ jsx27(ModalProvider, { children: /* @__PURE__ */ jsx27(BusinessProvider, { children }) }) });
|
|
3235
3255
|
};
|
|
3236
3256
|
var context_default = Providers;
|
|
3237
3257
|
|
|
@@ -4451,9 +4471,9 @@ import {
|
|
|
4451
4471
|
okxWallet,
|
|
4452
4472
|
walletConnectWallet
|
|
4453
4473
|
} from "@rainbow-me/rainbowkit/wallets";
|
|
4454
|
-
import { arbitrum, base, bsc, mainnet, optimism, polygon
|
|
4474
|
+
import { arbitrum, base, bsc, mainnet, optimism, polygon } from "wagmi/chains";
|
|
4455
4475
|
import { WagmiProvider } from "wagmi";
|
|
4456
|
-
import { jsx as
|
|
4476
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4457
4477
|
var queryClient = new QueryClient();
|
|
4458
4478
|
var wagmiConfig = getDefaultConfig({
|
|
4459
4479
|
appName: "MatchID",
|
|
@@ -4470,7 +4490,7 @@ var wagmiConfig = getDefaultConfig({
|
|
|
4470
4490
|
]
|
|
4471
4491
|
}
|
|
4472
4492
|
],
|
|
4473
|
-
chains: [mainnet, polygon, optimism, arbitrum, base,
|
|
4493
|
+
chains: [mainnet, polygon, optimism, arbitrum, base, matchMain, matchTest, bsc]
|
|
4474
4494
|
});
|
|
4475
4495
|
var MatchContext = createContext3(void 0);
|
|
4476
4496
|
var MatchProvider = ({
|
|
@@ -4492,7 +4512,7 @@ var MatchProvider = ({
|
|
|
4492
4512
|
useWalletInit({
|
|
4493
4513
|
config: wallet
|
|
4494
4514
|
});
|
|
4495
|
-
return /* @__PURE__ */
|
|
4515
|
+
return /* @__PURE__ */ jsx28(IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ jsx28(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx28(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx28(
|
|
4496
4516
|
MatchContext.Provider,
|
|
4497
4517
|
{
|
|
4498
4518
|
value: {
|
|
@@ -4503,7 +4523,7 @@ var MatchProvider = ({
|
|
|
4503
4523
|
theme,
|
|
4504
4524
|
locale: realLocale
|
|
4505
4525
|
},
|
|
4506
|
-
children: /* @__PURE__ */
|
|
4526
|
+
children: /* @__PURE__ */ jsx28(context_default, { children })
|
|
4507
4527
|
}
|
|
4508
4528
|
) }) }) });
|
|
4509
4529
|
};
|
|
@@ -4538,8 +4558,8 @@ function useUserInfo() {
|
|
|
4538
4558
|
const { open: TONOpen } = useTONModalStore();
|
|
4539
4559
|
const { open: BTCOpen } = useBTCModalStore();
|
|
4540
4560
|
const { open: CEXBindOpen } = useCEXBindModalStore();
|
|
4541
|
-
const { open: EmailOpen } = useEmailModalStore();
|
|
4542
4561
|
const walletModalStore = useWalletModalStore();
|
|
4562
|
+
const emailModalStore = useEmailModalStore();
|
|
4543
4563
|
const getRedirectUri = () => {
|
|
4544
4564
|
return encodeURIComponent(window.location.href);
|
|
4545
4565
|
};
|
|
@@ -4632,8 +4652,8 @@ function useUserInfo() {
|
|
|
4632
4652
|
case "discord":
|
|
4633
4653
|
case "github":
|
|
4634
4654
|
case "linkedin":
|
|
4635
|
-
case "kakao":
|
|
4636
4655
|
case "facebook":
|
|
4656
|
+
case "kakao":
|
|
4637
4657
|
return await loginByMethod(method);
|
|
4638
4658
|
default:
|
|
4639
4659
|
throw new Error("unsupported method");
|
|
@@ -4673,34 +4693,6 @@ function useUserInfo() {
|
|
|
4673
4693
|
}
|
|
4674
4694
|
return false;
|
|
4675
4695
|
};
|
|
4676
|
-
const bindByEmail = async ({
|
|
4677
|
-
email,
|
|
4678
|
-
code
|
|
4679
|
-
}) => {
|
|
4680
|
-
try {
|
|
4681
|
-
const obj = {
|
|
4682
|
-
email,
|
|
4683
|
-
verification_key: emailLoginKey,
|
|
4684
|
-
verification_code: code
|
|
4685
|
-
};
|
|
4686
|
-
const res = await verifyEmailCodeApi(obj);
|
|
4687
|
-
if (res && res.data && isSuccess(res)) {
|
|
4688
|
-
events.onBind && events.onBind({
|
|
4689
|
-
type: "email"
|
|
4690
|
-
});
|
|
4691
|
-
eventManager_default.emit("onBind", {
|
|
4692
|
-
type: "email"
|
|
4693
|
-
});
|
|
4694
|
-
return true;
|
|
4695
|
-
} else {
|
|
4696
|
-
throw new Error(res.message);
|
|
4697
|
-
}
|
|
4698
|
-
} catch (error) {
|
|
4699
|
-
console.error("bindByEmail", error);
|
|
4700
|
-
throw error;
|
|
4701
|
-
}
|
|
4702
|
-
return false;
|
|
4703
|
-
};
|
|
4704
4696
|
const bindWallet = async () => {
|
|
4705
4697
|
if (!token) {
|
|
4706
4698
|
throw new Error("You must login first");
|
|
@@ -4746,18 +4738,18 @@ function useUserInfo() {
|
|
|
4746
4738
|
return TONOpen("bind");
|
|
4747
4739
|
case "btc":
|
|
4748
4740
|
return BTCOpen("bind");
|
|
4741
|
+
case "email":
|
|
4742
|
+
return emailModalStore.open("bind");
|
|
4749
4743
|
case "telegram":
|
|
4750
4744
|
return await bindTelegram();
|
|
4751
|
-
case "email":
|
|
4752
|
-
return EmailOpen("bind");
|
|
4753
4745
|
case "twitter":
|
|
4754
4746
|
case "google":
|
|
4755
4747
|
case "discord":
|
|
4756
4748
|
case "github":
|
|
4757
4749
|
case "linkedin":
|
|
4758
4750
|
case "facebook":
|
|
4759
|
-
case "kakao":
|
|
4760
4751
|
case "youtube":
|
|
4752
|
+
case "kakao":
|
|
4761
4753
|
const link = `${endpoints.back}api/v1/auth/${method == "youtube" ? "google" : method}?appid=${appid}&provider=${method == "youtube" ? "google" : method}&redirect=${encodeURIComponent(endpoints.auth + "bind/" + method)}&authorization=${token.includes("Bearer ") ? token.split(" ")[1] : token}${method == "youtube" ? "&auth_type=youtube" : ""}`;
|
|
4762
4754
|
matchlog_default.log("link", link);
|
|
4763
4755
|
return window.open(
|
|
@@ -4772,6 +4764,31 @@ function useUserInfo() {
|
|
|
4772
4764
|
const bindCex = (type) => {
|
|
4773
4765
|
return CEXBindOpen(type);
|
|
4774
4766
|
};
|
|
4767
|
+
const bindByEmail = async ({ email, code }) => {
|
|
4768
|
+
try {
|
|
4769
|
+
const obj = {
|
|
4770
|
+
email,
|
|
4771
|
+
verification_key: emailLoginKey,
|
|
4772
|
+
verification_code: code
|
|
4773
|
+
};
|
|
4774
|
+
const res = await verifyEmailCodeApi(obj);
|
|
4775
|
+
if (res && res.data && isSuccess(res)) {
|
|
4776
|
+
events.onBind && events.onBind({
|
|
4777
|
+
type: "email"
|
|
4778
|
+
});
|
|
4779
|
+
eventManager_default.emit("onBind", {
|
|
4780
|
+
type: "email"
|
|
4781
|
+
});
|
|
4782
|
+
return true;
|
|
4783
|
+
} else {
|
|
4784
|
+
throw new Error(res.message);
|
|
4785
|
+
}
|
|
4786
|
+
} catch (error) {
|
|
4787
|
+
console.error("bindByEmail", error);
|
|
4788
|
+
throw error;
|
|
4789
|
+
}
|
|
4790
|
+
return false;
|
|
4791
|
+
};
|
|
4775
4792
|
const getAuthInfo = async (method) => {
|
|
4776
4793
|
const element_id = "auth_iframe";
|
|
4777
4794
|
if (document.getElementById(element_id)) {
|
|
@@ -4840,7 +4857,6 @@ function useUserInfo() {
|
|
|
4840
4857
|
auth,
|
|
4841
4858
|
login: loginMethod,
|
|
4842
4859
|
bind,
|
|
4843
|
-
getBindEmailCode: getLoginEmailCode,
|
|
4844
4860
|
bindByEmail,
|
|
4845
4861
|
getAuthInfo,
|
|
4846
4862
|
invite
|
|
@@ -4850,10 +4866,10 @@ function useUserInfo() {
|
|
|
4850
4866
|
// src/components/EmailModal/StepVerify.tsx
|
|
4851
4867
|
import { useEffect as useEffect20, useMemo as useMemo9, useRef as useRef6, useState as useState18 } from "react";
|
|
4852
4868
|
import { FormattedMessage as FormattedMessage6, useIntl as useIntl7 } from "react-intl";
|
|
4853
|
-
import { jsx as
|
|
4869
|
+
import { jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4854
4870
|
function StepVerify(props) {
|
|
4855
4871
|
const intl = useIntl7();
|
|
4856
|
-
const { getLoginEmailCode,
|
|
4872
|
+
const { getLoginEmailCode, loginByEmail, bindByEmail } = useUserInfo();
|
|
4857
4873
|
const [error, setError] = useState18("");
|
|
4858
4874
|
const [code, setCode] = useState18("");
|
|
4859
4875
|
const [sending, setSending] = useState18(false);
|
|
@@ -4932,15 +4948,15 @@ function StepVerify(props) {
|
|
|
4932
4948
|
};
|
|
4933
4949
|
return /* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-box", children: [
|
|
4934
4950
|
/* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-header", children: [
|
|
4935
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ jsx29(EmailLineIcon, { size: isDownMd ? 19 : 24 }) }),
|
|
4936
4952
|
/* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-header-content", children: [
|
|
4937
|
-
/* @__PURE__ */
|
|
4938
|
-
/* @__PURE__ */
|
|
4953
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-email-verify-header-value", children: props.email }),
|
|
4954
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-email-verify-header-tips", children: /* @__PURE__ */ jsx29(FormattedMessage6, { id: "sendEmailTips" }) })
|
|
4939
4955
|
] })
|
|
4940
4956
|
] }),
|
|
4941
|
-
/* @__PURE__ */
|
|
4957
|
+
/* @__PURE__ */ jsx29(Field, { label: intl.formatMessage({
|
|
4942
4958
|
id: "verificationCode"
|
|
4943
|
-
}), error, children: /* @__PURE__ */
|
|
4959
|
+
}), error, children: /* @__PURE__ */ jsx29(
|
|
4944
4960
|
Input,
|
|
4945
4961
|
{
|
|
4946
4962
|
placeholder: intl.formatMessage({
|
|
@@ -4950,7 +4966,7 @@ function StepVerify(props) {
|
|
|
4950
4966
|
maxLength: codeLength,
|
|
4951
4967
|
onChange: (e) => setCode(e.target.value),
|
|
4952
4968
|
value: code,
|
|
4953
|
-
after: /* @__PURE__ */
|
|
4969
|
+
after: /* @__PURE__ */ jsx29(
|
|
4954
4970
|
Button,
|
|
4955
4971
|
{
|
|
4956
4972
|
highlight: true,
|
|
@@ -4969,20 +4985,20 @@ function StepVerify(props) {
|
|
|
4969
4985
|
)
|
|
4970
4986
|
}
|
|
4971
4987
|
) }),
|
|
4972
|
-
/* @__PURE__ */
|
|
4988
|
+
/* @__PURE__ */ jsx29(Button, { disabled: !canContinue, loading: submitting, highlight: true, block: true, size: "lg", onClick: onContinue, children: /* @__PURE__ */ jsx29(FormattedMessage6, { id: "continue" }) })
|
|
4973
4989
|
] });
|
|
4974
4990
|
}
|
|
4975
4991
|
|
|
4976
4992
|
// src/components/EmailModal/index.tsx
|
|
4977
4993
|
import { useIntl as useIntl8 } from "react-intl";
|
|
4978
|
-
import { jsx as
|
|
4994
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
4979
4995
|
function EmailModal({
|
|
4980
4996
|
isOpen = false,
|
|
4981
|
-
type = "login",
|
|
4982
4997
|
width = 480,
|
|
4983
4998
|
onClose,
|
|
4984
4999
|
onBack,
|
|
4985
|
-
onLogin
|
|
5000
|
+
onLogin,
|
|
5001
|
+
type = "login"
|
|
4986
5002
|
}) {
|
|
4987
5003
|
const [step, setStep] = useState19("input");
|
|
4988
5004
|
const [emailVal, setEmailVal] = useState19("");
|
|
@@ -4993,14 +5009,7 @@ function EmailModal({
|
|
|
4993
5009
|
setEmailVal("");
|
|
4994
5010
|
}
|
|
4995
5011
|
}, [isOpen]);
|
|
4996
|
-
|
|
4997
|
-
if (onLogin) {
|
|
4998
|
-
onLogin();
|
|
4999
|
-
} else {
|
|
5000
|
-
onClose && onClose();
|
|
5001
|
-
}
|
|
5002
|
-
};
|
|
5003
|
-
return /* @__PURE__ */ jsx29(
|
|
5012
|
+
return /* @__PURE__ */ jsx30(
|
|
5004
5013
|
ModalWithHeader,
|
|
5005
5014
|
{
|
|
5006
5015
|
isOpen,
|
|
@@ -5010,10 +5019,10 @@ function EmailModal({
|
|
|
5010
5019
|
id: "email"
|
|
5011
5020
|
}),
|
|
5012
5021
|
onBack: step == "verify" ? () => setStep("input") : onBack,
|
|
5013
|
-
children: step === "input" ? /* @__PURE__ */
|
|
5022
|
+
children: step === "input" ? /* @__PURE__ */ jsx30(StepEmail, { email: emailVal, onContinue: (email) => {
|
|
5014
5023
|
setEmailVal(email);
|
|
5015
5024
|
setStep("verify");
|
|
5016
|
-
} }) : /* @__PURE__ */
|
|
5025
|
+
} }) : /* @__PURE__ */ jsx30(StepVerify, { type, email: emailVal, onSuccess: onLogin })
|
|
5017
5026
|
}
|
|
5018
5027
|
);
|
|
5019
5028
|
}
|
|
@@ -5043,7 +5052,7 @@ function useAppConfig() {
|
|
|
5043
5052
|
}
|
|
5044
5053
|
|
|
5045
5054
|
// src/components/LoginBox/index.tsx
|
|
5046
|
-
import { Fragment as Fragment5, jsx as
|
|
5055
|
+
import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5047
5056
|
var RecommendItem = ({
|
|
5048
5057
|
icon,
|
|
5049
5058
|
name,
|
|
@@ -5055,17 +5064,17 @@ var RecommendItem = ({
|
|
|
5055
5064
|
return /* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method", children: [
|
|
5056
5065
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method-item", onClick, children: [
|
|
5057
5066
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method-content", children: [
|
|
5058
|
-
/* @__PURE__ */
|
|
5059
|
-
/* @__PURE__ */
|
|
5067
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-recommend-method-icon", children: icon }),
|
|
5068
|
+
/* @__PURE__ */ jsx31("span", { className: "matchid-login-recommend-method-name", children: name })
|
|
5060
5069
|
] }),
|
|
5061
|
-
footer ? footer : children ? /* @__PURE__ */
|
|
5070
|
+
footer ? footer : children ? /* @__PURE__ */ jsx31(
|
|
5062
5071
|
ArrowDownIcon,
|
|
5063
5072
|
{
|
|
5064
5073
|
className: `matchid-login-recommend-method-arrow ${showChildren ? "matchid-login-recommend-method-arrow-active" : ""}`,
|
|
5065
5074
|
size: 20,
|
|
5066
5075
|
color: "var(--matchid-arrow-color)"
|
|
5067
5076
|
}
|
|
5068
|
-
) : /* @__PURE__ */
|
|
5077
|
+
) : /* @__PURE__ */ jsx31(
|
|
5069
5078
|
ArrowRightIcon,
|
|
5070
5079
|
{
|
|
5071
5080
|
className: "matchid-login-recommend-method-arrow",
|
|
@@ -5074,7 +5083,7 @@ var RecommendItem = ({
|
|
|
5074
5083
|
}
|
|
5075
5084
|
)
|
|
5076
5085
|
] }),
|
|
5077
|
-
children && /* @__PURE__ */
|
|
5086
|
+
children && /* @__PURE__ */ jsx31(
|
|
5078
5087
|
"div",
|
|
5079
5088
|
{
|
|
5080
5089
|
className: `matchid-login-recommend-method-popover ${showChildren ? "matchid-login-recommend-method-popover-active" : ""}`,
|
|
@@ -5111,7 +5120,7 @@ function LoginBox({
|
|
|
5111
5120
|
}
|
|
5112
5121
|
return p.toLowerCase();
|
|
5113
5122
|
});
|
|
5114
|
-
console.log("
|
|
5123
|
+
console.log("platform", platform);
|
|
5115
5124
|
const walletMethodList = WALLET_METHODS.filter((m) => platform.includes(m));
|
|
5116
5125
|
let recommendMethodList = walletMethodList.length > 0 ? ["wallet"] : [];
|
|
5117
5126
|
let methodList = [];
|
|
@@ -5132,182 +5141,196 @@ function LoginBox({
|
|
|
5132
5141
|
walletMethods: walletMethodList
|
|
5133
5142
|
};
|
|
5134
5143
|
}, [config.platform, recommendMethods, methods, walletMethods]);
|
|
5135
|
-
const
|
|
5144
|
+
const [emailOpen, setEmailOpen] = useState20(false);
|
|
5136
5145
|
const { login } = useUserInfo();
|
|
5137
5146
|
const [showWallet, setShowWallet] = useState20(false);
|
|
5138
5147
|
const intl = useIntl9();
|
|
5139
5148
|
const isDownMd = useDownMd();
|
|
5140
5149
|
const methodMap = {
|
|
5141
5150
|
wallet: {
|
|
5142
|
-
icon: /* @__PURE__ */
|
|
5151
|
+
icon: /* @__PURE__ */ jsx31(WalletIcon, { size: isDownMd ? 36 : 40 }),
|
|
5143
5152
|
name: intl.formatMessage({ id: "wallet" }),
|
|
5144
5153
|
onClick: () => setShowWallet(!showWallet),
|
|
5145
5154
|
type: "wallet"
|
|
5146
5155
|
},
|
|
5147
5156
|
email: {
|
|
5148
|
-
icon: /* @__PURE__ */
|
|
5157
|
+
icon: /* @__PURE__ */ jsx31(EmailIcon, { size: isDownMd ? 36 : 40 }),
|
|
5149
5158
|
name: intl.formatMessage({ id: "email" }),
|
|
5150
5159
|
onClick: () => {
|
|
5151
|
-
|
|
5160
|
+
setEmailOpen(true);
|
|
5152
5161
|
}
|
|
5153
5162
|
},
|
|
5154
5163
|
google: {
|
|
5155
|
-
icon: /* @__PURE__ */
|
|
5164
|
+
icon: /* @__PURE__ */ jsx31(GoogleIcon, { size: isDownMd ? 36 : 40 }),
|
|
5156
5165
|
name: "Google",
|
|
5157
5166
|
onClick: () => login("google")
|
|
5158
5167
|
},
|
|
5159
5168
|
twitter: {
|
|
5160
|
-
icon: /* @__PURE__ */
|
|
5169
|
+
icon: /* @__PURE__ */ jsx31(XIcon, { size: isDownMd ? 36 : 40 }),
|
|
5161
5170
|
name: "X",
|
|
5162
5171
|
onClick: () => login("twitter")
|
|
5163
5172
|
},
|
|
5164
5173
|
telegram: {
|
|
5165
|
-
icon: /* @__PURE__ */
|
|
5174
|
+
icon: /* @__PURE__ */ jsx31(TelegramIcon, { size: isDownMd ? 36 : 40 }),
|
|
5166
5175
|
name: "Telegram",
|
|
5167
5176
|
onClick: () => login("telegram")
|
|
5168
5177
|
},
|
|
5169
5178
|
github: {
|
|
5170
|
-
icon: /* @__PURE__ */
|
|
5179
|
+
icon: /* @__PURE__ */ jsx31(GithubIcon, { size: isDownMd ? 36 : 40 }),
|
|
5171
5180
|
name: "Github",
|
|
5172
5181
|
onClick: () => login("github")
|
|
5173
5182
|
},
|
|
5174
5183
|
discord: {
|
|
5175
|
-
icon: /* @__PURE__ */
|
|
5184
|
+
icon: /* @__PURE__ */ jsx31(DiscordIcon, { size: isDownMd ? 36 : 40 }),
|
|
5176
5185
|
name: "Discord",
|
|
5177
5186
|
onClick: () => login("discord")
|
|
5178
5187
|
},
|
|
5179
5188
|
linkedin: {
|
|
5180
|
-
icon: /* @__PURE__ */
|
|
5189
|
+
icon: /* @__PURE__ */ jsx31(LinkedinIcon, { size: isDownMd ? 36 : 40 }),
|
|
5181
5190
|
name: "LinkedIn",
|
|
5182
5191
|
onClick: () => login("linkedin")
|
|
5183
5192
|
},
|
|
5184
5193
|
facebook: {
|
|
5185
|
-
icon: /* @__PURE__ */
|
|
5194
|
+
icon: /* @__PURE__ */ jsx31(FacebookIcon, { size: isDownMd ? 36 : 40 }),
|
|
5186
5195
|
name: "Facebook",
|
|
5187
5196
|
onClick: () => login("facebook")
|
|
5188
5197
|
},
|
|
5189
5198
|
youtube: {
|
|
5190
|
-
icon: /* @__PURE__ */
|
|
5199
|
+
icon: /* @__PURE__ */ jsx31(YoutubeIcon, { size: isDownMd ? 36 : 40 }),
|
|
5191
5200
|
name: "Youtube",
|
|
5192
5201
|
onClick: () => login("youtube")
|
|
5193
5202
|
},
|
|
5194
5203
|
kakao: {
|
|
5195
|
-
icon: /* @__PURE__ */
|
|
5204
|
+
icon: /* @__PURE__ */ jsx31(KakaoIcon, { size: isDownMd ? 36 : 40 }),
|
|
5196
5205
|
name: "Kakao",
|
|
5197
5206
|
onClick: () => login("kakao")
|
|
5198
5207
|
}
|
|
5199
5208
|
};
|
|
5200
5209
|
const { walletMap } = useWalletConfig();
|
|
5201
|
-
return /* @__PURE__ */
|
|
5202
|
-
/* @__PURE__ */
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
/* @__PURE__ */
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
/* @__PURE__ */
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5210
|
+
return /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
5211
|
+
(!inModal || !emailOpen) && /* @__PURE__ */ jsxs16("div", { className: "matchid-login-box", children: [
|
|
5212
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
|
|
5213
|
+
return /* @__PURE__ */ jsx31(
|
|
5214
|
+
RecommendItem,
|
|
5215
|
+
{
|
|
5216
|
+
icon: methodMap[m]?.icon,
|
|
5217
|
+
name: methodMap[m]?.name,
|
|
5218
|
+
onClick: methodMap[m]?.onClick,
|
|
5219
|
+
showChildren: m == "wallet" && showWallet,
|
|
5220
|
+
children: m == "wallet" && /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
5221
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-recommend-wallet-divider" }),
|
|
5222
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
|
|
5223
|
+
const m2 = walletMap[n];
|
|
5224
|
+
return /* @__PURE__ */ jsxs16(
|
|
5225
|
+
"div",
|
|
5226
|
+
{
|
|
5227
|
+
className: "matchid-login-recommend-wallet-item",
|
|
5228
|
+
onClick: () => {
|
|
5229
|
+
login(m2.method);
|
|
5230
|
+
},
|
|
5231
|
+
children: [
|
|
5232
|
+
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-wallet-item-content", children: [
|
|
5233
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
|
|
5234
|
+
/* @__PURE__ */ jsx31(
|
|
5235
|
+
"div",
|
|
5236
|
+
{
|
|
5237
|
+
className: "matchid-login-recommend-wallet-item-hover-icon",
|
|
5238
|
+
children: m2.activeIcon
|
|
5239
|
+
}
|
|
5240
|
+
),
|
|
5241
|
+
/* @__PURE__ */ jsx31(
|
|
5242
|
+
"span",
|
|
5243
|
+
{
|
|
5244
|
+
className: "matchid-login-recommend-wallet-item-name",
|
|
5245
|
+
children: m2.name
|
|
5246
|
+
}
|
|
5247
|
+
)
|
|
5248
|
+
] }),
|
|
5249
|
+
/* @__PURE__ */ jsx31(
|
|
5250
|
+
ArrowRightIcon,
|
|
5233
5251
|
{
|
|
5234
|
-
className: "matchid-login-recommend-wallet-item-
|
|
5235
|
-
|
|
5252
|
+
className: "matchid-login-recommend-wallet-item-arrow",
|
|
5253
|
+
size: 20,
|
|
5254
|
+
color: "var(--matchid-arrow-color)"
|
|
5236
5255
|
}
|
|
5237
5256
|
)
|
|
5238
|
-
]
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
color: "var(--matchid-arrow-color)"
|
|
5245
|
-
}
|
|
5246
|
-
)
|
|
5247
|
-
]
|
|
5248
|
-
},
|
|
5249
|
-
m2.name
|
|
5250
|
-
);
|
|
5251
|
-
}) })
|
|
5252
|
-
] })
|
|
5253
|
-
},
|
|
5254
|
-
m
|
|
5255
|
-
);
|
|
5256
|
-
}) }),
|
|
5257
|
-
/* @__PURE__ */ jsxs16("div", { className: "matchid-privacy-policy", children: [
|
|
5258
|
-
/* @__PURE__ */ jsx30("div", { className: "matchid-privacy-policy-content", children: /* @__PURE__ */ jsx30(
|
|
5259
|
-
FormattedMessage7,
|
|
5260
|
-
{
|
|
5261
|
-
id: "loginAgreement",
|
|
5262
|
-
values: {
|
|
5263
|
-
termsLink: (chunks) => /* @__PURE__ */ jsx30(
|
|
5264
|
-
"a",
|
|
5265
|
-
{
|
|
5266
|
-
href: TERMS_OF_SERVICE_URL,
|
|
5267
|
-
target: "_blank",
|
|
5268
|
-
rel: "noopener noreferrer",
|
|
5269
|
-
className: "matchid-privacy-policy-content-link",
|
|
5270
|
-
children: chunks
|
|
5271
|
-
}
|
|
5272
|
-
),
|
|
5273
|
-
privacyLink: (chunks) => /* @__PURE__ */ jsx30(
|
|
5274
|
-
"a",
|
|
5275
|
-
{
|
|
5276
|
-
href: PRIVACY_POLICY_URL,
|
|
5277
|
-
target: "_blank",
|
|
5278
|
-
rel: "noopener noreferrer",
|
|
5279
|
-
className: "matchid-privacy-policy-content-link",
|
|
5280
|
-
children: chunks
|
|
5281
|
-
}
|
|
5282
|
-
)
|
|
5283
|
-
}
|
|
5284
|
-
}
|
|
5285
|
-
) }),
|
|
5286
|
-
/* @__PURE__ */ jsxs16("div", { className: "matchid-privacy-policy-powered-by", children: [
|
|
5287
|
-
/* @__PURE__ */ jsx30(FormattedMessage7, { id: "poweredBy" }),
|
|
5288
|
-
/* @__PURE__ */ jsx30(MatchIdIcon_default, {})
|
|
5289
|
-
] })
|
|
5290
|
-
] }),
|
|
5291
|
-
methodConfig.methods.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "matchid-login-other", children: [
|
|
5292
|
-
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-other-line-box", children: [
|
|
5293
|
-
/* @__PURE__ */ jsx30("div", { className: "matchid-login-other-line" }),
|
|
5294
|
-
/* @__PURE__ */ jsx30("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ jsx30(FormattedMessage7, { id: "otherLoginMethods" }) }),
|
|
5295
|
-
/* @__PURE__ */ jsx30("div", { className: "matchid-login-other-line" })
|
|
5296
|
-
] }),
|
|
5297
|
-
/* @__PURE__ */ jsx30("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
5298
|
-
return /* @__PURE__ */ jsx30(
|
|
5299
|
-
"div",
|
|
5300
|
-
{
|
|
5301
|
-
className: "matchid-login-method-item",
|
|
5302
|
-
onClick: methodMap[m]?.onClick,
|
|
5303
|
-
title: methodMap[m]?.name,
|
|
5304
|
-
children: methodMap[m]?.icon
|
|
5257
|
+
]
|
|
5258
|
+
},
|
|
5259
|
+
m2.name
|
|
5260
|
+
);
|
|
5261
|
+
}) })
|
|
5262
|
+
] })
|
|
5305
5263
|
},
|
|
5306
5264
|
m
|
|
5307
5265
|
);
|
|
5308
|
-
}) })
|
|
5309
|
-
|
|
5310
|
-
|
|
5266
|
+
}) }),
|
|
5267
|
+
/* @__PURE__ */ jsxs16("div", { className: "matchid-privacy-policy", children: [
|
|
5268
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-privacy-policy-content", children: /* @__PURE__ */ jsx31(
|
|
5269
|
+
FormattedMessage7,
|
|
5270
|
+
{
|
|
5271
|
+
id: "loginAgreement",
|
|
5272
|
+
values: {
|
|
5273
|
+
termsLink: (chunks) => /* @__PURE__ */ jsx31(
|
|
5274
|
+
"a",
|
|
5275
|
+
{
|
|
5276
|
+
href: TERMS_OF_SERVICE_URL,
|
|
5277
|
+
target: "_blank",
|
|
5278
|
+
rel: "noopener noreferrer",
|
|
5279
|
+
className: "matchid-privacy-policy-content-link",
|
|
5280
|
+
children: chunks
|
|
5281
|
+
}
|
|
5282
|
+
),
|
|
5283
|
+
privacyLink: (chunks) => /* @__PURE__ */ jsx31(
|
|
5284
|
+
"a",
|
|
5285
|
+
{
|
|
5286
|
+
href: PRIVACY_POLICY_URL,
|
|
5287
|
+
target: "_blank",
|
|
5288
|
+
rel: "noopener noreferrer",
|
|
5289
|
+
className: "matchid-privacy-policy-content-link",
|
|
5290
|
+
children: chunks
|
|
5291
|
+
}
|
|
5292
|
+
)
|
|
5293
|
+
}
|
|
5294
|
+
}
|
|
5295
|
+
) }),
|
|
5296
|
+
/* @__PURE__ */ jsxs16("div", { className: "matchid-privacy-policy-powered-by", children: [
|
|
5297
|
+
/* @__PURE__ */ jsx31(FormattedMessage7, { id: "poweredBy" }),
|
|
5298
|
+
/* @__PURE__ */ jsx31(MatchIdIcon_default, {})
|
|
5299
|
+
] })
|
|
5300
|
+
] }),
|
|
5301
|
+
methodConfig.methods.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "matchid-login-other", children: [
|
|
5302
|
+
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-other-line-box", children: [
|
|
5303
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-other-line" }),
|
|
5304
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ jsx31(FormattedMessage7, { id: "otherLoginMethods" }) }),
|
|
5305
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-other-line" })
|
|
5306
|
+
] }),
|
|
5307
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
5308
|
+
return /* @__PURE__ */ jsx31(
|
|
5309
|
+
"div",
|
|
5310
|
+
{
|
|
5311
|
+
className: "matchid-login-method-item",
|
|
5312
|
+
onClick: methodMap[m]?.onClick,
|
|
5313
|
+
title: methodMap[m]?.name,
|
|
5314
|
+
children: methodMap[m]?.icon
|
|
5315
|
+
},
|
|
5316
|
+
m
|
|
5317
|
+
);
|
|
5318
|
+
}) })
|
|
5319
|
+
] })
|
|
5320
|
+
] }),
|
|
5321
|
+
/* @__PURE__ */ jsx31(
|
|
5322
|
+
EmailModal,
|
|
5323
|
+
{
|
|
5324
|
+
isOpen: emailOpen,
|
|
5325
|
+
onClose: () => {
|
|
5326
|
+
setEmailOpen(false);
|
|
5327
|
+
},
|
|
5328
|
+
onBack: inModal ? () => {
|
|
5329
|
+
setEmailOpen(false);
|
|
5330
|
+
} : void 0
|
|
5331
|
+
}
|
|
5332
|
+
)
|
|
5333
|
+
] });
|
|
5311
5334
|
}
|
|
5312
5335
|
|
|
5313
5336
|
// src/components/LoginButton/index.tsx
|
|
@@ -5315,7 +5338,7 @@ import { useState as useState22 } from "react";
|
|
|
5315
5338
|
|
|
5316
5339
|
// src/components/LoginPanel/index.tsx
|
|
5317
5340
|
import { FormattedMessage as FormattedMessage8 } from "react-intl";
|
|
5318
|
-
import { jsx as
|
|
5341
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5319
5342
|
function LoginPanel({
|
|
5320
5343
|
header,
|
|
5321
5344
|
onClose,
|
|
@@ -5325,30 +5348,30 @@ function LoginPanel({
|
|
|
5325
5348
|
return /* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel", children: [
|
|
5326
5349
|
header ? header : /* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel-header", children: [
|
|
5327
5350
|
/* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel-header-content", children: [
|
|
5328
|
-
/* @__PURE__ */
|
|
5329
|
-
/* @__PURE__ */
|
|
5351
|
+
/* @__PURE__ */ jsx32("div", { className: "matchid-login-panel-header-title", children: /* @__PURE__ */ jsx32(FormattedMessage8, { id: "loginTitle" }) }),
|
|
5352
|
+
/* @__PURE__ */ jsx32("div", { className: "matchid-login-panel-header-subtilte", children: /* @__PURE__ */ jsx32(FormattedMessage8, { id: "loginTips" }) })
|
|
5330
5353
|
] }),
|
|
5331
|
-
onClose && /* @__PURE__ */
|
|
5354
|
+
onClose && /* @__PURE__ */ jsx32("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ jsx32(CloseRoundIcon, { size: isDownMd ? 24 : 30 }) })
|
|
5332
5355
|
] }),
|
|
5333
|
-
/* @__PURE__ */
|
|
5334
|
-
/* @__PURE__ */
|
|
5356
|
+
/* @__PURE__ */ jsx32("div", { className: "matchid-login-panel-divide" }),
|
|
5357
|
+
/* @__PURE__ */ jsx32("div", { className: "matchid-login-panel-box", children: /* @__PURE__ */ jsx32(LoginBox, { ...props }) })
|
|
5335
5358
|
] });
|
|
5336
5359
|
}
|
|
5337
5360
|
|
|
5338
5361
|
// src/components/LoginModal/index.tsx
|
|
5339
|
-
import { jsx as
|
|
5362
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5340
5363
|
function LoginModal({
|
|
5341
5364
|
isOpen = false,
|
|
5342
5365
|
width = 480,
|
|
5343
5366
|
...props
|
|
5344
5367
|
}) {
|
|
5345
5368
|
const { isLogin } = useUserInfo();
|
|
5346
|
-
return /* @__PURE__ */
|
|
5369
|
+
return /* @__PURE__ */ jsx33(
|
|
5347
5370
|
Modal,
|
|
5348
5371
|
{
|
|
5349
5372
|
isOpen: isOpen && !isLogin,
|
|
5350
5373
|
width,
|
|
5351
|
-
children: /* @__PURE__ */
|
|
5374
|
+
children: /* @__PURE__ */ jsx33(LoginPanel, { ...props, inModal: true })
|
|
5352
5375
|
}
|
|
5353
5376
|
);
|
|
5354
5377
|
}
|
|
@@ -5357,10 +5380,10 @@ function LoginModal({
|
|
|
5357
5380
|
import { useState as useState21 } from "react";
|
|
5358
5381
|
|
|
5359
5382
|
// src/assets/icon/ProfileIcon.tsx
|
|
5360
|
-
import { jsx as
|
|
5383
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5361
5384
|
function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
5362
5385
|
return /* @__PURE__ */ jsxs18("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5363
|
-
/* @__PURE__ */
|
|
5386
|
+
/* @__PURE__ */ jsx34(
|
|
5364
5387
|
"path",
|
|
5365
5388
|
{
|
|
5366
5389
|
fillRule: "evenodd",
|
|
@@ -5369,7 +5392,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
5369
5392
|
fill: color
|
|
5370
5393
|
}
|
|
5371
5394
|
),
|
|
5372
|
-
/* @__PURE__ */
|
|
5395
|
+
/* @__PURE__ */ jsx34(
|
|
5373
5396
|
"path",
|
|
5374
5397
|
{
|
|
5375
5398
|
fillRule: "evenodd",
|
|
@@ -5383,7 +5406,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
5383
5406
|
|
|
5384
5407
|
// src/components/UserPopover/index.tsx
|
|
5385
5408
|
import { FormattedMessage as FormattedMessage9, useIntl as useIntl10 } from "react-intl";
|
|
5386
|
-
import { jsx as
|
|
5409
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5387
5410
|
function UserContent() {
|
|
5388
5411
|
const { logout, address, username } = useUserInfo();
|
|
5389
5412
|
const [logouting, setLogouting] = useState21(false);
|
|
@@ -5407,31 +5430,31 @@ function UserContent() {
|
|
|
5407
5430
|
return /* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-item", onClick, children: [
|
|
5408
5431
|
/* @__PURE__ */ jsxs19("div", { className: `matchid-user-popover-item-content`, children: [
|
|
5409
5432
|
icon,
|
|
5410
|
-
/* @__PURE__ */
|
|
5433
|
+
/* @__PURE__ */ jsx35("div", { className: "matchid-user-popover-item-text", children })
|
|
5411
5434
|
] }),
|
|
5412
5435
|
rightIcon
|
|
5413
5436
|
] });
|
|
5414
5437
|
};
|
|
5415
5438
|
const UserDivider = () => {
|
|
5416
|
-
return /* @__PURE__ */
|
|
5439
|
+
return /* @__PURE__ */ jsx35("div", { className: `matchid-user-popover-divider` });
|
|
5417
5440
|
};
|
|
5418
5441
|
const [usernameOpen, setUsernameOpen] = useState21(false);
|
|
5419
5442
|
const [copied, setCopied] = useCopyClipboard();
|
|
5420
5443
|
const intl = useIntl10();
|
|
5421
5444
|
return /* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-content", children: [
|
|
5422
5445
|
/* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-list", children: [
|
|
5423
|
-
/* @__PURE__ */
|
|
5446
|
+
/* @__PURE__ */ jsx35(UserItem, { onClick: () => {
|
|
5424
5447
|
setCopied(address);
|
|
5425
|
-
}, icon: copied ? /* @__PURE__ */
|
|
5426
|
-
/* @__PURE__ */
|
|
5427
|
-
/* @__PURE__ */
|
|
5448
|
+
}, icon: copied ? /* @__PURE__ */ jsx35(CheckIcon, { size: 20, color: "#0ecb81" }) : /* @__PURE__ */ jsx35(CopyIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx35(CheckIcon, { size: 20, color: "var(--icon-color)" }), children: truncateAddress(address) }),
|
|
5449
|
+
/* @__PURE__ */ jsx35(UserDivider, {}),
|
|
5450
|
+
/* @__PURE__ */ jsx35(UserItem, { onClick: () => {
|
|
5428
5451
|
setUsernameOpen(true);
|
|
5429
|
-
}, icon: /* @__PURE__ */
|
|
5452
|
+
}, icon: /* @__PURE__ */ jsx35(ProfileIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx35(ArrowRightIcon, { size: 20, color: "var(--icon-color)" }), children: username || intl.formatMessage({
|
|
5430
5453
|
id: "setUsername"
|
|
5431
5454
|
}) })
|
|
5432
5455
|
] }),
|
|
5433
|
-
/* @__PURE__ */
|
|
5434
|
-
/* @__PURE__ */
|
|
5456
|
+
/* @__PURE__ */ jsx35(Button, { onClick: onLogout, loading: logouting, children: /* @__PURE__ */ jsx35(FormattedMessage9, { id: "disconnect" }) }),
|
|
5457
|
+
/* @__PURE__ */ jsx35(UsernameModal, { isOpen: usernameOpen, onClose: () => {
|
|
5435
5458
|
setUsernameOpen(false);
|
|
5436
5459
|
}, onSuccess: () => {
|
|
5437
5460
|
setUsernameOpen(false);
|
|
@@ -5442,12 +5465,12 @@ function UserPopover({
|
|
|
5442
5465
|
children,
|
|
5443
5466
|
...props
|
|
5444
5467
|
}) {
|
|
5445
|
-
return /* @__PURE__ */
|
|
5468
|
+
return /* @__PURE__ */ jsx35(Popover, { ...props, content: /* @__PURE__ */ jsx35(UserContent, {}), children });
|
|
5446
5469
|
}
|
|
5447
5470
|
|
|
5448
5471
|
// src/components/LoginButton/index.tsx
|
|
5449
5472
|
import { FormattedMessage as FormattedMessage10, useIntl as useIntl11 } from "react-intl";
|
|
5450
|
-
import { Fragment as Fragment6, jsx as
|
|
5473
|
+
import { Fragment as Fragment6, jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5451
5474
|
function LoginButton({
|
|
5452
5475
|
loginRender,
|
|
5453
5476
|
methods,
|
|
@@ -5464,7 +5487,7 @@ function LoginButton({
|
|
|
5464
5487
|
const [loginOpen, setLoginOpen] = useState22(false);
|
|
5465
5488
|
if (!isLogin) {
|
|
5466
5489
|
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
5467
|
-
/* @__PURE__ */
|
|
5490
|
+
/* @__PURE__ */ jsx36(
|
|
5468
5491
|
LoginModal,
|
|
5469
5492
|
{
|
|
5470
5493
|
methods,
|
|
@@ -5475,14 +5498,14 @@ function LoginButton({
|
|
|
5475
5498
|
}
|
|
5476
5499
|
),
|
|
5477
5500
|
/* @__PURE__ */ jsxs20(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
|
|
5478
|
-
/* @__PURE__ */
|
|
5479
|
-
/* @__PURE__ */
|
|
5501
|
+
/* @__PURE__ */ jsx36(UnLoginIcon_default, {}),
|
|
5502
|
+
/* @__PURE__ */ jsx36("span", { children: /* @__PURE__ */ jsx36(FormattedMessage10, { id: "login" }) })
|
|
5480
5503
|
] })
|
|
5481
5504
|
] });
|
|
5482
5505
|
}
|
|
5483
|
-
return loginRender ? /* @__PURE__ */
|
|
5484
|
-
/* @__PURE__ */
|
|
5485
|
-
/* @__PURE__ */
|
|
5506
|
+
return loginRender ? /* @__PURE__ */ jsx36(Fragment6, { children: loginRender }) : /* @__PURE__ */ jsx36(UserPopover, { position: popoverPosition, type: popoverType, gap: popoverGap, children: /* @__PURE__ */ jsxs20(Button, { onClick: onLoginClick, className: "matchid-login-btn", ...props, children: [
|
|
5507
|
+
/* @__PURE__ */ jsx36(LoginIcon_default, {}),
|
|
5508
|
+
/* @__PURE__ */ jsx36("span", { children: username ? truncateAddress(username) : "MatchID " + intl.formatMessage({
|
|
5486
5509
|
id: "user"
|
|
5487
5510
|
}) })
|
|
5488
5511
|
] }) });
|
|
@@ -5491,15 +5514,15 @@ function LoginButton({
|
|
|
5491
5514
|
// src/components/UsernameModal/index.tsx
|
|
5492
5515
|
import { useEffect as useEffect22, useMemo as useMemo11, useState as useState23 } from "react";
|
|
5493
5516
|
import { FormattedMessage as FormattedMessage11, useIntl as useIntl12 } from "react-intl";
|
|
5494
|
-
import { jsx as
|
|
5517
|
+
import { jsx as jsx37, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5495
5518
|
var ValidItem = ({
|
|
5496
5519
|
success = false,
|
|
5497
5520
|
text
|
|
5498
5521
|
}) => {
|
|
5499
5522
|
const isDownMd = useDownMd();
|
|
5500
5523
|
return /* @__PURE__ */ jsxs21("div", { className: `matchid-valid-status-item matchid-valid-status-${success ? "success" : "error"}`, children: [
|
|
5501
|
-
success ? /* @__PURE__ */
|
|
5502
|
-
/* @__PURE__ */
|
|
5524
|
+
success ? /* @__PURE__ */ jsx37(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ jsx37(InfoLineIcon, { size: isDownMd ? 12 : 16 }),
|
|
5525
|
+
/* @__PURE__ */ jsx37("span", { children: text })
|
|
5503
5526
|
] });
|
|
5504
5527
|
};
|
|
5505
5528
|
function UsernameModal({
|
|
@@ -5547,12 +5570,12 @@ function UsernameModal({
|
|
|
5547
5570
|
}
|
|
5548
5571
|
};
|
|
5549
5572
|
const intl = useIntl12();
|
|
5550
|
-
return /* @__PURE__ */
|
|
5573
|
+
return /* @__PURE__ */ jsx37(ModalWithHeader, { isOpen: isOpen && isLogin, ...props, title: title || intl.formatMessage({
|
|
5551
5574
|
id: username ? "editUsernameTitle" : "setUsernameTitle"
|
|
5552
5575
|
}), children: /* @__PURE__ */ jsxs21("div", { className: "matchid-username-box", children: [
|
|
5553
|
-
/* @__PURE__ */
|
|
5576
|
+
/* @__PURE__ */ jsx37(Field, { label: intl.formatMessage({
|
|
5554
5577
|
id: "username"
|
|
5555
|
-
}), error, children: /* @__PURE__ */
|
|
5578
|
+
}), error, children: /* @__PURE__ */ jsx37(
|
|
5556
5579
|
Input,
|
|
5557
5580
|
{
|
|
5558
5581
|
placeholder: intl.formatMessage({
|
|
@@ -5566,7 +5589,7 @@ function UsernameModal({
|
|
|
5566
5589
|
}
|
|
5567
5590
|
) }),
|
|
5568
5591
|
/* @__PURE__ */ jsxs21("div", { className: "matchid-valid", children: [
|
|
5569
|
-
/* @__PURE__ */
|
|
5592
|
+
/* @__PURE__ */ jsx37(
|
|
5570
5593
|
ValidItem,
|
|
5571
5594
|
{
|
|
5572
5595
|
success: isValid,
|
|
@@ -5575,16 +5598,16 @@ function UsernameModal({
|
|
|
5575
5598
|
})
|
|
5576
5599
|
}
|
|
5577
5600
|
),
|
|
5578
|
-
/* @__PURE__ */
|
|
5601
|
+
/* @__PURE__ */ jsx37(ValidItem, { success: isLength, text: intl.formatMessage({
|
|
5579
5602
|
id: "usernameLengthError"
|
|
5580
5603
|
}) })
|
|
5581
5604
|
] }),
|
|
5582
|
-
/* @__PURE__ */
|
|
5605
|
+
/* @__PURE__ */ jsx37(Button, { disabled: !isSafe, loading: isSubmitting, style: {
|
|
5583
5606
|
marginTop: isDownMd ? "36px" : "64px"
|
|
5584
|
-
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */
|
|
5585
|
-
/* @__PURE__ */
|
|
5607
|
+
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ jsx37(FormattedMessage11, { id: "confirm" }) }),
|
|
5608
|
+
/* @__PURE__ */ jsx37(Button, { style: {
|
|
5586
5609
|
marginTop: isDownMd ? "12px" : "24px"
|
|
5587
|
-
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */
|
|
5610
|
+
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ jsx37(FormattedMessage11, { id: "cancel" }) })
|
|
5588
5611
|
] }) });
|
|
5589
5612
|
}
|
|
5590
5613
|
|
|
@@ -5603,7 +5626,7 @@ var walletConnectImage = wallet_default;
|
|
|
5603
5626
|
var walletSigningImage = signing_default;
|
|
5604
5627
|
|
|
5605
5628
|
// src/components/WalletModalContent/index.tsx
|
|
5606
|
-
import { jsx as
|
|
5629
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5607
5630
|
function WalletModalContent({
|
|
5608
5631
|
status,
|
|
5609
5632
|
error,
|
|
@@ -5673,15 +5696,15 @@ function WalletModalContent({
|
|
|
5673
5696
|
statusImage: walletConnectImage
|
|
5674
5697
|
};
|
|
5675
5698
|
}, [visible, connected, status, error, address]);
|
|
5676
|
-
return /* @__PURE__ */
|
|
5699
|
+
return /* @__PURE__ */ jsx38("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5677
5700
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5678
|
-
/* @__PURE__ */
|
|
5701
|
+
/* @__PURE__ */ jsx38(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5679
5702
|
width: 128,
|
|
5680
5703
|
height: 128
|
|
5681
5704
|
} }),
|
|
5682
|
-
/* @__PURE__ */
|
|
5705
|
+
/* @__PURE__ */ jsx38("div", { className: pageData.isError ? "matchid-error" : "", children: pageData.text })
|
|
5683
5706
|
] }),
|
|
5684
|
-
/* @__PURE__ */
|
|
5707
|
+
/* @__PURE__ */ jsx38(
|
|
5685
5708
|
Button,
|
|
5686
5709
|
{
|
|
5687
5710
|
block: true,
|
|
@@ -5757,15 +5780,15 @@ function WalletModalContentV2(props) {
|
|
|
5757
5780
|
statusImage: walletConnectImage
|
|
5758
5781
|
};
|
|
5759
5782
|
}, [props, submitting]);
|
|
5760
|
-
return /* @__PURE__ */
|
|
5783
|
+
return /* @__PURE__ */ jsx38("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5761
5784
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5762
|
-
/* @__PURE__ */
|
|
5785
|
+
/* @__PURE__ */ jsx38(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5763
5786
|
width: 128,
|
|
5764
5787
|
height: 128
|
|
5765
5788
|
} }),
|
|
5766
|
-
/* @__PURE__ */
|
|
5789
|
+
/* @__PURE__ */ jsx38("div", { className: props.status == "error" ? "matchid-error" : "", children: pageData.text })
|
|
5767
5790
|
] }),
|
|
5768
|
-
/* @__PURE__ */
|
|
5791
|
+
/* @__PURE__ */ jsx38(
|
|
5769
5792
|
Button,
|
|
5770
5793
|
{
|
|
5771
5794
|
block: true,
|
|
@@ -6047,7 +6070,7 @@ async function getEthersSigner(config, { chainId } = {}) {
|
|
|
6047
6070
|
// src/components/EVMModal/index.tsx
|
|
6048
6071
|
import { SiweMessage } from "siwe";
|
|
6049
6072
|
import "@rainbow-me/rainbowkit/styles.css";
|
|
6050
|
-
import { jsx as
|
|
6073
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
6051
6074
|
function WalletContent({
|
|
6052
6075
|
onSuccess,
|
|
6053
6076
|
type
|
|
@@ -6205,7 +6228,7 @@ function WalletContent({
|
|
|
6205
6228
|
setNonce(void 0);
|
|
6206
6229
|
setStatus("start");
|
|
6207
6230
|
};
|
|
6208
|
-
return /* @__PURE__ */
|
|
6231
|
+
return /* @__PURE__ */ jsx39(
|
|
6209
6232
|
WalletModalContentV2,
|
|
6210
6233
|
{
|
|
6211
6234
|
status,
|
|
@@ -6223,14 +6246,14 @@ function EVMConnectModal({
|
|
|
6223
6246
|
...props
|
|
6224
6247
|
}) {
|
|
6225
6248
|
const intl = useIntl13();
|
|
6226
|
-
return /* @__PURE__ */
|
|
6249
|
+
return /* @__PURE__ */ jsx39(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6227
6250
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6228
6251
|
}, {
|
|
6229
6252
|
name: "EVM"
|
|
6230
|
-
}), children: /* @__PURE__ */
|
|
6253
|
+
}), children: /* @__PURE__ */ jsx39(WalletContent, { onSuccess, type }) });
|
|
6231
6254
|
}
|
|
6232
6255
|
function EVMModal(props) {
|
|
6233
|
-
return props.isOpen && /* @__PURE__ */
|
|
6256
|
+
return props.isOpen && /* @__PURE__ */ jsx39(RainbowKitProvider2, { children: /* @__PURE__ */ jsx39(EVMConnectModal, { ...props }) });
|
|
6234
6257
|
}
|
|
6235
6258
|
|
|
6236
6259
|
// src/components/TRONModal/index.tsx
|
|
@@ -6345,7 +6368,7 @@ var useTRONWallet = () => {
|
|
|
6345
6368
|
};
|
|
6346
6369
|
|
|
6347
6370
|
// src/components/TRONModal/index.tsx
|
|
6348
|
-
import { jsx as
|
|
6371
|
+
import { jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6349
6372
|
function TRONConnectModal({
|
|
6350
6373
|
type = "login",
|
|
6351
6374
|
onSuccess,
|
|
@@ -6355,9 +6378,9 @@ function TRONConnectModal({
|
|
|
6355
6378
|
const intl = useIntl14();
|
|
6356
6379
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useTRONWallet();
|
|
6357
6380
|
const iconMaps = {
|
|
6358
|
-
tronlink: /* @__PURE__ */
|
|
6359
|
-
bitget: /* @__PURE__ */
|
|
6360
|
-
okx: /* @__PURE__ */
|
|
6381
|
+
tronlink: /* @__PURE__ */ jsx40(TronLinkIcon, { size: isDownMd ? 36 : 40 }),
|
|
6382
|
+
bitget: /* @__PURE__ */ jsx40(BitgetIcon, { size: isDownMd ? 36 : 40 }),
|
|
6383
|
+
okx: /* @__PURE__ */ jsx40(OKXIcon, { size: isDownMd ? 36 : 40 })
|
|
6361
6384
|
};
|
|
6362
6385
|
const { events, login } = useMatch();
|
|
6363
6386
|
const [status, setStatus] = useState28("");
|
|
@@ -6449,11 +6472,11 @@ function TRONConnectModal({
|
|
|
6449
6472
|
disconnect();
|
|
6450
6473
|
}
|
|
6451
6474
|
}, [props.isOpen]);
|
|
6452
|
-
return /* @__PURE__ */
|
|
6475
|
+
return /* @__PURE__ */ jsx40(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6453
6476
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6454
6477
|
}, {
|
|
6455
6478
|
name: "TRON"
|
|
6456
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */
|
|
6479
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ jsx40(
|
|
6457
6480
|
WalletModalContent,
|
|
6458
6481
|
{
|
|
6459
6482
|
error,
|
|
@@ -6466,9 +6489,9 @@ function TRONConnectModal({
|
|
|
6466
6489
|
setVisible: () => {
|
|
6467
6490
|
}
|
|
6468
6491
|
}
|
|
6469
|
-
) : /* @__PURE__ */
|
|
6492
|
+
) : /* @__PURE__ */ jsx40("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs23("div", { className: "matchid-login-recommend-list", children: [
|
|
6470
6493
|
installedWallets.map((wallet2) => {
|
|
6471
|
-
return /* @__PURE__ */
|
|
6494
|
+
return /* @__PURE__ */ jsx40(
|
|
6472
6495
|
RecommendItem,
|
|
6473
6496
|
{
|
|
6474
6497
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -6481,14 +6504,14 @@ function TRONConnectModal({
|
|
|
6481
6504
|
);
|
|
6482
6505
|
}),
|
|
6483
6506
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
6484
|
-
return /* @__PURE__ */
|
|
6507
|
+
return /* @__PURE__ */ jsx40(
|
|
6485
6508
|
RecommendItem,
|
|
6486
6509
|
{
|
|
6487
6510
|
icon: iconMaps[wallet2.walletKey],
|
|
6488
6511
|
name: wallet2.name,
|
|
6489
6512
|
onClick: () => {
|
|
6490
6513
|
},
|
|
6491
|
-
footer: /* @__PURE__ */
|
|
6514
|
+
footer: /* @__PURE__ */ jsx40(Button, { size: "sm", onClick: () => {
|
|
6492
6515
|
window.open(wallet2.website);
|
|
6493
6516
|
}, children: "Install" })
|
|
6494
6517
|
},
|
|
@@ -6498,7 +6521,7 @@ function TRONConnectModal({
|
|
|
6498
6521
|
] }) }) });
|
|
6499
6522
|
}
|
|
6500
6523
|
function TRONModal(props) {
|
|
6501
|
-
return props.isOpen && /* @__PURE__ */
|
|
6524
|
+
return props.isOpen && /* @__PURE__ */ jsx40(TRONConnectModal, { ...props, type: props.type });
|
|
6502
6525
|
}
|
|
6503
6526
|
|
|
6504
6527
|
// src/components/TONModal/index.tsx
|
|
@@ -6511,7 +6534,7 @@ import {
|
|
|
6511
6534
|
useTonConnectUI,
|
|
6512
6535
|
useTonWallet
|
|
6513
6536
|
} from "@tonconnect/ui-react";
|
|
6514
|
-
import { jsx as
|
|
6537
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
6515
6538
|
function WalletContent2({
|
|
6516
6539
|
onSuccess,
|
|
6517
6540
|
type
|
|
@@ -6638,7 +6661,7 @@ function WalletContent2({
|
|
|
6638
6661
|
}
|
|
6639
6662
|
}
|
|
6640
6663
|
}, [state]);
|
|
6641
|
-
return /* @__PURE__ */
|
|
6664
|
+
return /* @__PURE__ */ jsx41(
|
|
6642
6665
|
WalletModalContent,
|
|
6643
6666
|
{
|
|
6644
6667
|
connected,
|
|
@@ -6672,20 +6695,20 @@ function TONConnectModal({
|
|
|
6672
6695
|
const intl = useIntl15();
|
|
6673
6696
|
const { endpoints, appid } = useLocalStore_default();
|
|
6674
6697
|
const manifestUrl = `${endpoints.back}api/v1/wallet/ton?appid=${appid}&url=` + encodeURIComponent(window.location.origin);
|
|
6675
|
-
return /* @__PURE__ */
|
|
6698
|
+
return /* @__PURE__ */ jsx41(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6676
6699
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6677
6700
|
}, {
|
|
6678
6701
|
name: "TON"
|
|
6679
|
-
}), children: /* @__PURE__ */
|
|
6702
|
+
}), children: /* @__PURE__ */ jsx41(
|
|
6680
6703
|
TonConnectUIProvider,
|
|
6681
6704
|
{
|
|
6682
6705
|
manifestUrl,
|
|
6683
|
-
children: /* @__PURE__ */
|
|
6706
|
+
children: /* @__PURE__ */ jsx41(WalletContent2, { onSuccess, type })
|
|
6684
6707
|
}
|
|
6685
6708
|
) });
|
|
6686
6709
|
}
|
|
6687
6710
|
function TONModal(props) {
|
|
6688
|
-
return props.isOpen && /* @__PURE__ */
|
|
6711
|
+
return props.isOpen && /* @__PURE__ */ jsx41(TONConnectModal, { ...props });
|
|
6689
6712
|
}
|
|
6690
6713
|
|
|
6691
6714
|
// src/components/BTCModal/index.tsx
|
|
@@ -6914,7 +6937,7 @@ var useBTCWallet = () => {
|
|
|
6914
6937
|
};
|
|
6915
6938
|
|
|
6916
6939
|
// src/components/BTCModal/index.tsx
|
|
6917
|
-
import { jsx as
|
|
6940
|
+
import { jsx as jsx42, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6918
6941
|
function BTCConnectModal({
|
|
6919
6942
|
type = "login",
|
|
6920
6943
|
onSuccess,
|
|
@@ -6924,10 +6947,10 @@ function BTCConnectModal({
|
|
|
6924
6947
|
const intl = useIntl16();
|
|
6925
6948
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useBTCWallet();
|
|
6926
6949
|
const iconMaps = {
|
|
6927
|
-
leather: /* @__PURE__ */
|
|
6928
|
-
unisat: /* @__PURE__ */
|
|
6929
|
-
xverse: /* @__PURE__ */
|
|
6930
|
-
phantom: /* @__PURE__ */
|
|
6950
|
+
leather: /* @__PURE__ */ jsx42(LeatherIcon, { size: isDownMd ? 36 : 40 }),
|
|
6951
|
+
unisat: /* @__PURE__ */ jsx42(UnisatIcon, { size: isDownMd ? 36 : 40 }),
|
|
6952
|
+
xverse: /* @__PURE__ */ jsx42(XverseIcon, { size: isDownMd ? 36 : 40 }),
|
|
6953
|
+
phantom: /* @__PURE__ */ jsx42(PhantomIcon, { size: isDownMd ? 36 : 40 })
|
|
6931
6954
|
};
|
|
6932
6955
|
const { events, login } = useMatch();
|
|
6933
6956
|
const [status, setStatus] = useState31("");
|
|
@@ -7027,11 +7050,11 @@ function BTCConnectModal({
|
|
|
7027
7050
|
statusRef.current = "";
|
|
7028
7051
|
setError("");
|
|
7029
7052
|
};
|
|
7030
|
-
return /* @__PURE__ */
|
|
7053
|
+
return /* @__PURE__ */ jsx42(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
7031
7054
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
7032
7055
|
}, {
|
|
7033
7056
|
name: "BTC"
|
|
7034
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */
|
|
7057
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ jsx42(
|
|
7035
7058
|
WalletModalContent,
|
|
7036
7059
|
{
|
|
7037
7060
|
error,
|
|
@@ -7044,9 +7067,9 @@ function BTCConnectModal({
|
|
|
7044
7067
|
setVisible: () => {
|
|
7045
7068
|
}
|
|
7046
7069
|
}
|
|
7047
|
-
) : /* @__PURE__ */
|
|
7070
|
+
) : /* @__PURE__ */ jsx42("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs24("div", { className: "matchid-login-recommend-list", children: [
|
|
7048
7071
|
installedWallets.map((wallet2) => {
|
|
7049
|
-
return /* @__PURE__ */
|
|
7072
|
+
return /* @__PURE__ */ jsx42(
|
|
7050
7073
|
RecommendItem,
|
|
7051
7074
|
{
|
|
7052
7075
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -7059,14 +7082,14 @@ function BTCConnectModal({
|
|
|
7059
7082
|
);
|
|
7060
7083
|
}),
|
|
7061
7084
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
7062
|
-
return /* @__PURE__ */
|
|
7085
|
+
return /* @__PURE__ */ jsx42(
|
|
7063
7086
|
RecommendItem,
|
|
7064
7087
|
{
|
|
7065
7088
|
icon: iconMaps[wallet2.walletKey],
|
|
7066
7089
|
name: wallet2.name,
|
|
7067
7090
|
onClick: () => {
|
|
7068
7091
|
},
|
|
7069
|
-
footer: /* @__PURE__ */
|
|
7092
|
+
footer: /* @__PURE__ */ jsx42(Button, { size: "sm", onClick: () => {
|
|
7070
7093
|
window.open(wallet2.website);
|
|
7071
7094
|
}, children: "Install" })
|
|
7072
7095
|
},
|
|
@@ -7076,13 +7099,13 @@ function BTCConnectModal({
|
|
|
7076
7099
|
] }) }) });
|
|
7077
7100
|
}
|
|
7078
7101
|
function BTCModal(props) {
|
|
7079
|
-
return props.isOpen && /* @__PURE__ */
|
|
7102
|
+
return props.isOpen && /* @__PURE__ */ jsx42(BTCConnectModal, { ...props });
|
|
7080
7103
|
}
|
|
7081
7104
|
|
|
7082
7105
|
// src/components/WalletModal/index.tsx
|
|
7083
7106
|
import { useMemo as useMemo16 } from "react";
|
|
7084
7107
|
import { useIntl as useIntl17 } from "react-intl";
|
|
7085
|
-
import { jsx as
|
|
7108
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
7086
7109
|
function WalletConnectModal({
|
|
7087
7110
|
type,
|
|
7088
7111
|
methods: _methods,
|
|
@@ -7100,13 +7123,13 @@ function WalletConnectModal({
|
|
|
7100
7123
|
const platform = config.platform.map((p) => p.toLowerCase());
|
|
7101
7124
|
return WALLET_METHODS.filter((m) => platform.includes(m));
|
|
7102
7125
|
}, [config.platform, _methods]);
|
|
7103
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ jsx43(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
7104
7127
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
7105
7128
|
}, {
|
|
7106
7129
|
name: ""
|
|
7107
|
-
}), children: /* @__PURE__ */
|
|
7130
|
+
}), children: /* @__PURE__ */ jsx43("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsx43("div", { className: "matchid-login-recommend-list", children: methods.map((method, index) => {
|
|
7108
7131
|
const m = walletMap[method];
|
|
7109
|
-
return /* @__PURE__ */
|
|
7132
|
+
return /* @__PURE__ */ jsx43(
|
|
7110
7133
|
RecommendItem,
|
|
7111
7134
|
{
|
|
7112
7135
|
icon: m?.icon,
|
|
@@ -7120,12 +7143,12 @@ function WalletConnectModal({
|
|
|
7120
7143
|
}) }) }) });
|
|
7121
7144
|
}
|
|
7122
7145
|
function WalletModal(props) {
|
|
7123
|
-
return props.isOpen && /* @__PURE__ */
|
|
7146
|
+
return props.isOpen && /* @__PURE__ */ jsx43(WalletConnectModal, { ...props });
|
|
7124
7147
|
}
|
|
7125
7148
|
|
|
7126
7149
|
// src/components/AlphaAvatar/index.tsx
|
|
7127
7150
|
import { useEffect as useEffect30, useState as useState32 } from "react";
|
|
7128
|
-
import { jsx as
|
|
7151
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
7129
7152
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
7130
7153
|
const [avatar, setAvatar] = useState32(void 0);
|
|
7131
7154
|
useEffect30(() => {
|
|
@@ -7134,7 +7157,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
7134
7157
|
setAvatar(char);
|
|
7135
7158
|
}
|
|
7136
7159
|
}, [name]);
|
|
7137
|
-
return /* @__PURE__ */
|
|
7160
|
+
return /* @__PURE__ */ jsx44("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
7138
7161
|
width: size,
|
|
7139
7162
|
height: size,
|
|
7140
7163
|
fontSize: Math.ceil(size / 2)
|
|
@@ -7142,7 +7165,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
7142
7165
|
}
|
|
7143
7166
|
|
|
7144
7167
|
// src/components/WalletAsset/index.tsx
|
|
7145
|
-
import { jsx as
|
|
7168
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7146
7169
|
function WalletAsset({
|
|
7147
7170
|
onAssetClick,
|
|
7148
7171
|
matchWalletAssetsOptions
|
|
@@ -7152,7 +7175,7 @@ function WalletAsset({
|
|
|
7152
7175
|
list: walletAssets.mergedAssets
|
|
7153
7176
|
});
|
|
7154
7177
|
const { list } = useMatchChain();
|
|
7155
|
-
return /* @__PURE__ */
|
|
7178
|
+
return /* @__PURE__ */ jsx45("div", { className: "matchid-wallet-asset-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
7156
7179
|
const clickFunc = onAssetClick && onAssetClick(n);
|
|
7157
7180
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
7158
7181
|
const getFooterColor = () => {
|
|
@@ -7171,7 +7194,7 @@ function WalletAsset({
|
|
|
7171
7194
|
cursor: clickFunc ? "pointer" : "default"
|
|
7172
7195
|
}, children: [
|
|
7173
7196
|
/* @__PURE__ */ jsxs25("div", { className: "matchid-wallet-asset-logo", title: n.symbol || n.name || "", children: [
|
|
7174
|
-
n.icon ? /* @__PURE__ */
|
|
7197
|
+
n.icon ? /* @__PURE__ */ jsx45("img", { src: n.icon, alt: n.symbol, className: `matchid-wallet-asset-icon` }) : /* @__PURE__ */ jsx45(
|
|
7175
7198
|
AlphaAvatar2,
|
|
7176
7199
|
{
|
|
7177
7200
|
className: `matchid-wallet-asset-icon`,
|
|
@@ -7179,12 +7202,12 @@ function WalletAsset({
|
|
|
7179
7202
|
name: n.symbol || n.name || ""
|
|
7180
7203
|
}
|
|
7181
7204
|
),
|
|
7182
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7205
|
+
chain?.iconUrl && /* @__PURE__ */ jsx45("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-wallet-asset-chain` })
|
|
7183
7206
|
] }),
|
|
7184
7207
|
/* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-info`, children: [
|
|
7185
|
-
/* @__PURE__ */
|
|
7208
|
+
/* @__PURE__ */ jsx45("div", { className: `matchid-wallet-asset-name`, children: n.symbol }),
|
|
7186
7209
|
"price" in n && /* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-content`, children: [
|
|
7187
|
-
/* @__PURE__ */
|
|
7210
|
+
/* @__PURE__ */ jsx45("div", { className: "matchid-wallet-asset-price", children: /* @__PURE__ */ jsx45(
|
|
7188
7211
|
NumberFormatter,
|
|
7189
7212
|
{
|
|
7190
7213
|
value: n.price,
|
|
@@ -7192,7 +7215,7 @@ function WalletAsset({
|
|
|
7192
7215
|
tFixNum: 2
|
|
7193
7216
|
}
|
|
7194
7217
|
) }),
|
|
7195
|
-
/* @__PURE__ */
|
|
7218
|
+
/* @__PURE__ */ jsx45("div", { className: "matchid-wallet-asset-value", children: /* @__PURE__ */ jsx45(
|
|
7196
7219
|
NumberFormatter,
|
|
7197
7220
|
{
|
|
7198
7221
|
value: n.value,
|
|
@@ -7202,14 +7225,14 @@ function WalletAsset({
|
|
|
7202
7225
|
) })
|
|
7203
7226
|
] }),
|
|
7204
7227
|
/* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-footer`, children: [
|
|
7205
|
-
/* @__PURE__ */
|
|
7228
|
+
/* @__PURE__ */ jsx45("div", { className: `matchid-wallet-asset-balance`, children: /* @__PURE__ */ jsx45(
|
|
7206
7229
|
NumberFormatter,
|
|
7207
7230
|
{
|
|
7208
7231
|
value: n.balance,
|
|
7209
7232
|
tFixNum: 3
|
|
7210
7233
|
}
|
|
7211
7234
|
) }),
|
|
7212
|
-
"price_change_24h" in n && /* @__PURE__ */
|
|
7235
|
+
"price_change_24h" in n && /* @__PURE__ */ jsx45("div", { className: `matchid-wallet-asset-change ${getFooterColor()}`, children: /* @__PURE__ */ jsx45(
|
|
7213
7236
|
NumberFormatter,
|
|
7214
7237
|
{
|
|
7215
7238
|
prefix: `${(n?.price_change_24h || 0) < 0 ? "-" : "+"} `,
|
|
@@ -7228,7 +7251,7 @@ function WalletAsset({
|
|
|
7228
7251
|
import { useEffect as useEffect31, useMemo as useMemo17, useState as useState33 } from "react";
|
|
7229
7252
|
import { defineChain as defineChain4, encodeFunctionData as encodeFunctionData2, erc20Abi as erc20Abi3, http as http8, parseUnits as parseUnits2 } from "viem";
|
|
7230
7253
|
import { FormattedMessage as FormattedMessage12, useIntl as useIntl18 } from "react-intl";
|
|
7231
|
-
import { jsx as
|
|
7254
|
+
import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7232
7255
|
function Input2({
|
|
7233
7256
|
onChange,
|
|
7234
7257
|
placeholder,
|
|
@@ -7239,7 +7262,7 @@ function Input2({
|
|
|
7239
7262
|
size = "df"
|
|
7240
7263
|
}) {
|
|
7241
7264
|
return /* @__PURE__ */ jsxs26("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
7242
|
-
/* @__PURE__ */
|
|
7265
|
+
/* @__PURE__ */ jsx46(
|
|
7243
7266
|
"input",
|
|
7244
7267
|
{
|
|
7245
7268
|
placeholder,
|
|
@@ -7250,7 +7273,7 @@ function Input2({
|
|
|
7250
7273
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
7251
7274
|
}
|
|
7252
7275
|
),
|
|
7253
|
-
error && /* @__PURE__ */
|
|
7276
|
+
error && /* @__PURE__ */ jsx46("div", { className: "matchid-token-input-error-text", children: error })
|
|
7254
7277
|
] });
|
|
7255
7278
|
}
|
|
7256
7279
|
function TokenSend({
|
|
@@ -7378,24 +7401,24 @@ function TokenSend({
|
|
|
7378
7401
|
window.removeEventListener("message", receiveMessage);
|
|
7379
7402
|
};
|
|
7380
7403
|
}, []);
|
|
7381
|
-
return /* @__PURE__ */
|
|
7404
|
+
return /* @__PURE__ */ jsx46(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ jsx46(FormattedMessage12, { id: "send" }), onBack, children: /* @__PURE__ */ jsxs26("div", { className: `matchid-token-send-box`, children: [
|
|
7382
7405
|
/* @__PURE__ */ jsxs26("div", { className: "matchid-token-send-content", children: [
|
|
7383
7406
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-content`, children: [
|
|
7384
7407
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-header`, children: [
|
|
7385
|
-
/* @__PURE__ */
|
|
7408
|
+
/* @__PURE__ */ jsx46("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ jsx46(FormattedMessage12, { id: "amount" }) }),
|
|
7386
7409
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-chain`, children: [
|
|
7387
|
-
token.icon ? /* @__PURE__ */
|
|
7410
|
+
token.icon ? /* @__PURE__ */ jsx46(
|
|
7388
7411
|
"img",
|
|
7389
7412
|
{
|
|
7390
7413
|
src: token?.icon,
|
|
7391
7414
|
alt: token?.symbol,
|
|
7392
7415
|
className: `matchid-token-amount-chain-icon`
|
|
7393
7416
|
}
|
|
7394
|
-
) : /* @__PURE__ */
|
|
7395
|
-
/* @__PURE__ */
|
|
7417
|
+
) : /* @__PURE__ */ jsx46(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
7418
|
+
/* @__PURE__ */ jsx46("span", { children: token?.symbol })
|
|
7396
7419
|
] })
|
|
7397
7420
|
] }),
|
|
7398
|
-
/* @__PURE__ */
|
|
7421
|
+
/* @__PURE__ */ jsx46(
|
|
7399
7422
|
Input2,
|
|
7400
7423
|
{
|
|
7401
7424
|
type: "text",
|
|
@@ -7410,16 +7433,16 @@ function TokenSend({
|
|
|
7410
7433
|
),
|
|
7411
7434
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-footer`, children: [
|
|
7412
7435
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-title`, children: [
|
|
7413
|
-
/* @__PURE__ */
|
|
7436
|
+
/* @__PURE__ */ jsx46(FormattedMessage12, { id: "balance" }),
|
|
7414
7437
|
":"
|
|
7415
7438
|
] }),
|
|
7416
|
-
/* @__PURE__ */
|
|
7439
|
+
/* @__PURE__ */ jsx46("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ jsx46(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
7417
7440
|
] }),
|
|
7418
|
-
/* @__PURE__ */
|
|
7441
|
+
/* @__PURE__ */ jsx46(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
7419
7442
|
] }),
|
|
7420
7443
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-address-content`, children: [
|
|
7421
|
-
/* @__PURE__ */
|
|
7422
|
-
/* @__PURE__ */
|
|
7444
|
+
/* @__PURE__ */ jsx46("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ jsx46("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ jsx46(FormattedMessage12, { id: "receiveTitle" }) }) }),
|
|
7445
|
+
/* @__PURE__ */ jsx46(
|
|
7423
7446
|
Input2,
|
|
7424
7447
|
{
|
|
7425
7448
|
type: "text",
|
|
@@ -7435,7 +7458,7 @@ function TokenSend({
|
|
|
7435
7458
|
)
|
|
7436
7459
|
] })
|
|
7437
7460
|
] }),
|
|
7438
|
-
/* @__PURE__ */
|
|
7461
|
+
/* @__PURE__ */ jsx46(
|
|
7439
7462
|
Button,
|
|
7440
7463
|
{
|
|
7441
7464
|
size: "lg",
|
|
@@ -7444,7 +7467,7 @@ function TokenSend({
|
|
|
7444
7467
|
disabled: !canSend || !!txError,
|
|
7445
7468
|
onClick: onNext,
|
|
7446
7469
|
loading: loading || sending,
|
|
7447
|
-
children: /* @__PURE__ */
|
|
7470
|
+
children: /* @__PURE__ */ jsx46(FormattedMessage12, { id: "next" })
|
|
7448
7471
|
}
|
|
7449
7472
|
)
|
|
7450
7473
|
] }) });
|
|
@@ -7452,7 +7475,7 @@ function TokenSend({
|
|
|
7452
7475
|
|
|
7453
7476
|
// src/components/TokenDetail/index.tsx
|
|
7454
7477
|
import { FormattedMessage as FormattedMessage13, useIntl as useIntl19 } from "react-intl";
|
|
7455
|
-
import { jsx as
|
|
7478
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7456
7479
|
function TokenDetail({
|
|
7457
7480
|
onClose,
|
|
7458
7481
|
token
|
|
@@ -7462,41 +7485,41 @@ function TokenDetail({
|
|
|
7462
7485
|
const chain = chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
7463
7486
|
const onSend = () => {
|
|
7464
7487
|
modal.show((props) => {
|
|
7465
|
-
return /* @__PURE__ */
|
|
7488
|
+
return /* @__PURE__ */ jsx47(TokenSend, { onClose: () => {
|
|
7466
7489
|
props.close();
|
|
7467
7490
|
onClose();
|
|
7468
7491
|
}, onBack: props.close, zIndex: props.zIndex, token });
|
|
7469
7492
|
});
|
|
7470
7493
|
};
|
|
7471
7494
|
const intl = useIntl19();
|
|
7472
|
-
return /* @__PURE__ */
|
|
7495
|
+
return /* @__PURE__ */ jsx47(ModalDrawer, { isOpen: true, title: intl.formatMessage({
|
|
7473
7496
|
id: "tokenDetails"
|
|
7474
7497
|
}), onClose, children: /* @__PURE__ */ jsxs27("div", { className: `matchid-token-detail`, children: [
|
|
7475
7498
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-main`, children: [
|
|
7476
7499
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-info`, children: [
|
|
7477
7500
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-logo`, children: [
|
|
7478
|
-
token.icon ? /* @__PURE__ */
|
|
7479
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7501
|
+
token.icon ? /* @__PURE__ */ jsx47("img", { src: token.icon, alt: token.symbol, className: `matchid-token-icon` }) : /* @__PURE__ */ jsx47(AlphaAvatar, { className: `matchid-token-icon`, size: 48, name: token.symbol || token.name || "" }),
|
|
7502
|
+
chain?.iconUrl && /* @__PURE__ */ jsx47("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-token-chain` })
|
|
7480
7503
|
] }),
|
|
7481
7504
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-name`, children: [
|
|
7482
|
-
/* @__PURE__ */
|
|
7505
|
+
/* @__PURE__ */ jsx47(NumberFormatter, { value: token.balance, tFixNum: 10 }),
|
|
7483
7506
|
" ",
|
|
7484
7507
|
token.symbol
|
|
7485
7508
|
] })
|
|
7486
7509
|
] }),
|
|
7487
7510
|
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ jsxs27("div", { className: `matchid-token-contract`, children: [
|
|
7488
|
-
/* @__PURE__ */
|
|
7489
|
-
/* @__PURE__ */
|
|
7511
|
+
/* @__PURE__ */ jsx47("div", { className: "matchid-token-contract-title", children: "Contract address" }),
|
|
7512
|
+
/* @__PURE__ */ jsx47("div", { className: "matchid-token-contract-address", children: token.address })
|
|
7490
7513
|
] })
|
|
7491
7514
|
] }),
|
|
7492
|
-
/* @__PURE__ */
|
|
7515
|
+
/* @__PURE__ */ jsx47(Button, { size: "lg", block: true, highlight: true, onClick: onSend, children: /* @__PURE__ */ jsx47(FormattedMessage13, { id: "send" }) })
|
|
7493
7516
|
] }) });
|
|
7494
7517
|
}
|
|
7495
7518
|
|
|
7496
7519
|
// src/components/TokenSendList/index.tsx
|
|
7497
7520
|
import { useState as useState34 } from "react";
|
|
7498
7521
|
import { FormattedMessage as FormattedMessage14 } from "react-intl";
|
|
7499
|
-
import { jsx as
|
|
7522
|
+
import { jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7500
7523
|
function TokenSendList({ close }) {
|
|
7501
7524
|
const isDownMd = useDownMd();
|
|
7502
7525
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -7508,14 +7531,14 @@ function TokenSendList({ close }) {
|
|
|
7508
7531
|
const modal = useModal();
|
|
7509
7532
|
const onNext = () => {
|
|
7510
7533
|
checked && modal.show((props) => {
|
|
7511
|
-
return /* @__PURE__ */
|
|
7534
|
+
return /* @__PURE__ */ jsx48(TokenSend, { onClose: () => {
|
|
7512
7535
|
props.close();
|
|
7513
7536
|
close();
|
|
7514
7537
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
7515
7538
|
});
|
|
7516
7539
|
};
|
|
7517
7540
|
return /* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-list-box", children: [
|
|
7518
|
-
/* @__PURE__ */
|
|
7541
|
+
/* @__PURE__ */ jsx48("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
7519
7542
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
7520
7543
|
return /* @__PURE__ */ jsxs28(
|
|
7521
7544
|
"div",
|
|
@@ -7525,10 +7548,10 @@ function TokenSendList({ close }) {
|
|
|
7525
7548
|
setChecked(n);
|
|
7526
7549
|
},
|
|
7527
7550
|
children: [
|
|
7528
|
-
/* @__PURE__ */
|
|
7551
|
+
/* @__PURE__ */ jsx48(Radio, { checked: checked?.address == n.address, size: isDownMd ? 18 : 24 }),
|
|
7529
7552
|
/* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-content", children: [
|
|
7530
7553
|
/* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-logo", children: [
|
|
7531
|
-
n.icon ? /* @__PURE__ */
|
|
7554
|
+
n.icon ? /* @__PURE__ */ jsx48("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ jsx48(
|
|
7532
7555
|
AlphaAvatar2,
|
|
7533
7556
|
{
|
|
7534
7557
|
className: `matchid-token-send-icon`,
|
|
@@ -7536,7 +7559,7 @@ function TokenSendList({ close }) {
|
|
|
7536
7559
|
name: n.symbol || n.name || ""
|
|
7537
7560
|
}
|
|
7538
7561
|
),
|
|
7539
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7562
|
+
chain?.iconUrl && /* @__PURE__ */ jsx48(
|
|
7540
7563
|
"img",
|
|
7541
7564
|
{
|
|
7542
7565
|
src: chain.iconUrl,
|
|
@@ -7546,8 +7569,8 @@ function TokenSendList({ close }) {
|
|
|
7546
7569
|
)
|
|
7547
7570
|
] }),
|
|
7548
7571
|
/* @__PURE__ */ jsxs28("div", { className: `matchid-token-send-info`, children: [
|
|
7549
|
-
/* @__PURE__ */
|
|
7550
|
-
/* @__PURE__ */
|
|
7572
|
+
/* @__PURE__ */ jsx48("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
7573
|
+
/* @__PURE__ */ jsx48("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ jsx48(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
7551
7574
|
] })
|
|
7552
7575
|
] })
|
|
7553
7576
|
]
|
|
@@ -7555,7 +7578,7 @@ function TokenSendList({ close }) {
|
|
|
7555
7578
|
index
|
|
7556
7579
|
);
|
|
7557
7580
|
}) }),
|
|
7558
|
-
/* @__PURE__ */
|
|
7581
|
+
/* @__PURE__ */ jsx48(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ jsx48(FormattedMessage14, { id: "next" }) })
|
|
7559
7582
|
] });
|
|
7560
7583
|
}
|
|
7561
7584
|
|
|
@@ -7565,7 +7588,7 @@ import { useEffect as useEffect32, useMemo as useMemo18, useState as useState35
|
|
|
7565
7588
|
import { decodeFunctionData, defineChain as defineChain5, formatUnits as formatUnits3 } from "viem";
|
|
7566
7589
|
import { erc20Abi as erc20Abi4 } from "viem";
|
|
7567
7590
|
import { FormattedMessage as FormattedMessage15 } from "react-intl";
|
|
7568
|
-
import { jsx as
|
|
7591
|
+
import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7569
7592
|
var Item = ({ data }) => {
|
|
7570
7593
|
const { address } = useWallet();
|
|
7571
7594
|
const isOut = data.from.toLowerCase() == address.toLowerCase();
|
|
@@ -7660,10 +7683,10 @@ var Item = ({ data }) => {
|
|
|
7660
7683
|
className: `matchid-transaction-item`,
|
|
7661
7684
|
children: [
|
|
7662
7685
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transacton-item-container`, children: [
|
|
7663
|
-
/* @__PURE__ */
|
|
7686
|
+
/* @__PURE__ */ jsx49("div", { className: "matchid-transaction-item-icon", children: /* @__PURE__ */ jsx49(ArrowSendIcon, { className: !isOut ? "rotate-180" : "" }) }),
|
|
7664
7687
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transaction-item-details`, children: [
|
|
7665
|
-
/* @__PURE__ */
|
|
7666
|
-
/* @__PURE__ */
|
|
7688
|
+
/* @__PURE__ */ jsx49("div", { className: `matchid-transaction-item-address`, children: formatAddress(to, 6, 4) }),
|
|
7689
|
+
/* @__PURE__ */ jsx49(
|
|
7667
7690
|
"div",
|
|
7668
7691
|
{
|
|
7669
7692
|
className: `matchid-transaction-item-timestamp`,
|
|
@@ -7673,10 +7696,10 @@ var Item = ({ data }) => {
|
|
|
7673
7696
|
] })
|
|
7674
7697
|
] }),
|
|
7675
7698
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transaction-item-amount ${"matchid-transaction-item-" + status}`, children: [
|
|
7676
|
-
/* @__PURE__ */
|
|
7677
|
-
status == "loading" && /* @__PURE__ */
|
|
7678
|
-
status == "success" && /* @__PURE__ */
|
|
7679
|
-
status == "error" && /* @__PURE__ */
|
|
7699
|
+
/* @__PURE__ */ jsx49(NumberFormatter, { value: amount, tFixNum: 6, prefix: isOut ? "-" : "+", suffix: " " + symbol }),
|
|
7700
|
+
status == "loading" && /* @__PURE__ */ jsx49(LoadingIcon_default, { color: "#000000", size: 16, rotate: true }),
|
|
7701
|
+
status == "success" && /* @__PURE__ */ jsx49(CheckRoundIcon, { size: 16 }),
|
|
7702
|
+
status == "error" && /* @__PURE__ */ jsx49(InfoRoundIcon, { size: 16 })
|
|
7680
7703
|
] })
|
|
7681
7704
|
]
|
|
7682
7705
|
}
|
|
@@ -7686,7 +7709,7 @@ function TransactionList({
|
|
|
7686
7709
|
scrollableTarget
|
|
7687
7710
|
}) {
|
|
7688
7711
|
const { fetchMoreData, hasMore, items } = useMatchWalletRecords();
|
|
7689
|
-
return /* @__PURE__ */
|
|
7712
|
+
return /* @__PURE__ */ jsx49(
|
|
7690
7713
|
InfiniteScroll,
|
|
7691
7714
|
{
|
|
7692
7715
|
scrollableTarget,
|
|
@@ -7694,11 +7717,11 @@ function TransactionList({
|
|
|
7694
7717
|
next: fetchMoreData,
|
|
7695
7718
|
hasMore,
|
|
7696
7719
|
loader: /* @__PURE__ */ jsxs29("div", { className: "matchid-list-nomore", children: [
|
|
7697
|
-
/* @__PURE__ */
|
|
7720
|
+
/* @__PURE__ */ jsx49(LoadingIcon_default, { rotate: true, size: 16, color: "black" }),
|
|
7698
7721
|
"Loading..."
|
|
7699
7722
|
] }),
|
|
7700
|
-
endMessage: items.length > 0 ? /* @__PURE__ */
|
|
7701
|
-
children: items.length == 0 && !hasMore ? /* @__PURE__ */
|
|
7723
|
+
endMessage: items.length > 0 ? /* @__PURE__ */ jsx49("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ jsx49(FormattedMessage15, { id: "noMoreRecords" }) }) : /* @__PURE__ */ jsx49("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ jsx49(FormattedMessage15, { id: "noRecords" }) }),
|
|
7724
|
+
children: items.length == 0 && !hasMore ? /* @__PURE__ */ jsx49("div", { className: "mt-[150px]" }) : /* @__PURE__ */ jsx49("div", { className: `matchid-transaction-list`, children: items.map((item, index) => /* @__PURE__ */ jsx49(Item, { data: item }, index)) })
|
|
7702
7725
|
}
|
|
7703
7726
|
);
|
|
7704
7727
|
}
|
|
@@ -7773,4 +7796,4 @@ export {
|
|
|
7773
7796
|
MatchProvider,
|
|
7774
7797
|
useMatch
|
|
7775
7798
|
};
|
|
7776
|
-
//# sourceMappingURL=chunk-
|
|
7799
|
+
//# sourceMappingURL=chunk-QMV4FDUH.mjs.map
|