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