@matchain/matchid-sdk-react 0.1.34 → 0.1.36
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/index.css +406 -235
- package/dist/index.d.mts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +160 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +142 -98
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -325,24 +325,30 @@ function PasswordRoundIcon() {
|
|
|
325
325
|
|
|
326
326
|
// src/assets/icon/CloseEyeIcon.tsx
|
|
327
327
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
328
|
-
function CloseEyeIcon(
|
|
329
|
-
|
|
328
|
+
function CloseEyeIcon({
|
|
329
|
+
size = 20,
|
|
330
|
+
color = "#6E6E6E"
|
|
331
|
+
}) {
|
|
332
|
+
return /* @__PURE__ */ jsx17("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx17(
|
|
330
333
|
"path",
|
|
331
334
|
{
|
|
332
335
|
d: "M9.15132 12.5568V11.5464C8.21031 11.4949 7.28023 11.3193 6.38524 11.024L6.04233 11.9579C6.00626 12.0669 5.94867 12.1676 5.87299 12.2539C5.79731 12.3403 5.70508 12.4106 5.60174 12.4607C5.4984 12.5108 5.38607 12.5396 5.27139 12.5455C5.15671 12.5514 5.04201 12.5342 4.93409 12.4949C4.82617 12.4557 4.72722 12.3952 4.6431 12.317C4.55898 12.2389 4.49139 12.1446 4.44435 12.0399C4.3973 11.9351 4.37175 11.822 4.36921 11.7072C4.36667 11.5924 4.38719 11.4783 4.42955 11.3715L4.80788 10.3268C4.04603 9.88461 3.32634 9.37345 2.65789 8.79975C2.54358 8.70488 2.42928 8.61687 2.32184 8.52772C2.1442 8.38554 2.03031 8.17862 2.00523 7.95247C1.98015 7.72633 2.04593 7.49948 2.18811 7.32184C2.33028 7.1442 2.5372 7.03031 2.76335 7.00523C2.98949 6.98015 3.21634 7.04593 3.39398 7.18811C3.50828 7.27955 3.62258 7.37099 3.73689 7.47043C5.46065 9.00826 7.68996 9.85815 10 9.85815C12.31 9.85815 14.5393 9.00826 16.2631 7.47043C16.3774 7.37099 16.4917 7.27955 16.606 7.18811C16.694 7.11771 16.7949 7.06533 16.9031 7.03395C17.0114 7.00257 17.1247 6.99281 17.2367 7.00523C17.3486 7.01765 17.4571 7.052 17.5558 7.10632C17.6545 7.16065 17.7415 7.23388 17.8119 7.32184C17.8823 7.4098 17.9347 7.51077 17.9661 7.61897C17.9974 7.72717 18.0072 7.8405 17.9948 7.95247C17.9824 8.06445 17.948 8.17288 17.8937 8.27158C17.8394 8.37028 17.7661 8.45732 17.6782 8.52772L17.3421 8.79975C16.6737 9.37354 15.954 9.88471 15.1921 10.3268L15.5705 11.3715C15.6128 11.4783 15.6333 11.5924 15.6308 11.7072C15.6283 11.822 15.6027 11.9351 15.5557 12.0399C15.5086 12.1446 15.441 12.2389 15.3569 12.317C15.2728 12.3952 15.1738 12.4557 15.0659 12.4949C14.958 12.5342 14.8433 12.5514 14.7286 12.5455C14.6139 12.5396 14.5016 12.5108 14.3983 12.4607C14.2949 12.4106 14.2027 12.3403 14.127 12.2539C14.0513 12.1676 13.9937 12.0669 13.9577 11.9579L13.6148 11.024C12.7198 11.3193 11.7897 11.4949 10.8487 11.5464V12.5568C10.8487 12.7842 10.7584 13.0022 10.5976 13.163C10.4368 13.3238 10.2188 13.4141 9.99143 13.4141C9.76407 13.4141 9.54602 13.3238 9.38526 13.163C9.22449 13.0022 9.13417 12.7842 9.13417 12.5568H9.15132Z",
|
|
333
|
-
fill:
|
|
336
|
+
fill: color
|
|
334
337
|
}
|
|
335
338
|
) });
|
|
336
339
|
}
|
|
337
340
|
|
|
338
341
|
// src/assets/icon/OpenEyeIcon.tsx
|
|
339
342
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
340
|
-
function OpenEyeIcon(
|
|
341
|
-
|
|
343
|
+
function OpenEyeIcon({
|
|
344
|
+
size = 20,
|
|
345
|
+
color = "#6E6E6E"
|
|
346
|
+
}) {
|
|
347
|
+
return /* @__PURE__ */ jsx18("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx18(
|
|
342
348
|
"path",
|
|
343
349
|
{
|
|
344
350
|
d: "M10 6.4543C11.3373 6.44986 12.6486 6.82287 13.7834 7.53047C14.9181 8.23806 15.8301 9.25151 16.4145 10.4543C15.2145 12.9052 12.7564 14.4543 10 14.4543C7.24364 14.4543 4.78545 12.9052 3.58545 10.4543C4.1699 9.25151 5.08191 8.23806 6.21664 7.53047C7.35136 6.82287 8.66274 6.44986 10 6.4543ZM10 4.99976C6.36364 4.99976 3.25818 7.26157 2 10.4543C3.25818 13.647 6.36364 15.9088 10 15.9088C13.6364 15.9088 16.7418 13.647 18 10.4543C16.7418 7.26157 13.6364 4.99976 10 4.99976ZM10 8.63612C10.4822 8.63617 10.9446 8.82774 11.2855 9.16871C11.6265 9.50968 11.818 9.97212 11.818 10.4543C11.818 10.9365 11.6265 11.3989 11.2855 11.7399C10.9446 12.0809 10.4822 12.2724 10 12.2725C9.51782 12.2724 9.0554 12.0809 8.71447 11.7399C8.37353 11.3989 8.18199 10.9365 8.18199 10.4543C8.18199 9.97212 8.37353 9.50968 8.71447 9.16871C9.0554 8.82774 9.51782 8.63617 10 8.63612ZM10 7.18157C8.19636 7.18157 6.72727 8.65066 6.72727 10.4543C6.72727 12.2579 8.19636 13.727 10 13.727C11.8036 13.727 13.2727 12.2579 13.2727 10.4543C13.2727 8.65066 11.8036 7.18157 10 7.18157Z",
|
|
345
|
-
fill:
|
|
351
|
+
fill: color
|
|
346
352
|
}
|
|
347
353
|
) });
|
|
348
354
|
}
|
|
@@ -650,6 +656,26 @@ function ArrowDownIcon({ width = 20, height = 21, color = "black", ...props }) {
|
|
|
650
656
|
) });
|
|
651
657
|
}
|
|
652
658
|
|
|
659
|
+
// src/hooks/useLayout.tsx
|
|
660
|
+
var useLayout_exports = {};
|
|
661
|
+
__export(useLayout_exports, {
|
|
662
|
+
useDownMd: () => useDownMd
|
|
663
|
+
});
|
|
664
|
+
import { useState, useEffect } from "react";
|
|
665
|
+
function useDownMd() {
|
|
666
|
+
const [isBelowMd, setIsBelowMd] = useState(window.matchMedia("(max-width: 767px)").matches);
|
|
667
|
+
useEffect(() => {
|
|
668
|
+
const handleResize = () => {
|
|
669
|
+
setIsBelowMd(window.matchMedia("(max-width: 767px)").matches);
|
|
670
|
+
};
|
|
671
|
+
window.addEventListener("resize", handleResize);
|
|
672
|
+
return () => {
|
|
673
|
+
window.removeEventListener("resize", handleResize);
|
|
674
|
+
};
|
|
675
|
+
}, []);
|
|
676
|
+
return isBelowMd;
|
|
677
|
+
}
|
|
678
|
+
|
|
653
679
|
// src/components/Modal/index.tsx
|
|
654
680
|
import { Fragment, jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
655
681
|
function Modal({
|
|
@@ -666,9 +692,12 @@ function Modal({
|
|
|
666
692
|
style: {
|
|
667
693
|
zIndex
|
|
668
694
|
},
|
|
669
|
-
children: /* @__PURE__ */
|
|
695
|
+
children: /* @__PURE__ */ jsxs23("div", { className: `matchid-modal ${className}`, style: {
|
|
670
696
|
width
|
|
671
|
-
}, children
|
|
697
|
+
}, children: [
|
|
698
|
+
/* @__PURE__ */ jsx36("div", { className: "matchid-modal-mobile-header" }),
|
|
699
|
+
children
|
|
700
|
+
] })
|
|
672
701
|
}
|
|
673
702
|
) : /* @__PURE__ */ jsx36(Fragment, {});
|
|
674
703
|
}
|
|
@@ -681,23 +710,24 @@ function ModalWithHeader({
|
|
|
681
710
|
showClose = true,
|
|
682
711
|
...props
|
|
683
712
|
}) {
|
|
713
|
+
const isDownMd = useDownMd();
|
|
684
714
|
return /* @__PURE__ */ jsxs23(Modal, { ...props, children: [
|
|
685
715
|
/* @__PURE__ */ jsxs23("div", { className: `matchid-modal-header ${showBorder ? "matchid-modal-header-border" : ""}`, children: [
|
|
686
716
|
/* @__PURE__ */ jsxs23("div", { className: "matchid-modal-header-content", children: [
|
|
687
|
-
onBack && /* @__PURE__ */ jsx36(ArrowLeftIcon, { className: "matchid-modal-header-back", onClick: onBack }),
|
|
717
|
+
onBack && /* @__PURE__ */ jsx36(ArrowLeftIcon, { height: isDownMd ? 20 : 25, width: isDownMd ? 20 : 24, className: "matchid-modal-header-back", onClick: onBack }),
|
|
688
718
|
/* @__PURE__ */ jsx36("span", { className: "matchid-modal-header-title", children: title })
|
|
689
719
|
] }),
|
|
690
|
-
onClose && /* @__PURE__ */ jsx36(CloseRoundIcon, { className: "matchid-modal-header-close", onClick: onClose })
|
|
720
|
+
onClose && /* @__PURE__ */ jsx36(CloseRoundIcon, { size: isDownMd ? 24 : 30, className: "matchid-modal-header-close", onClick: onClose })
|
|
691
721
|
] }),
|
|
692
722
|
children
|
|
693
723
|
] });
|
|
694
724
|
}
|
|
695
725
|
|
|
696
726
|
// src/components/PasswordModal/index.tsx
|
|
697
|
-
import { useEffect as
|
|
727
|
+
import { useEffect as useEffect4, useMemo as useMemo2, useState as useState4 } from "react";
|
|
698
728
|
|
|
699
729
|
// src/components/Input/index.tsx
|
|
700
|
-
import { useState } from "react";
|
|
730
|
+
import { useState as useState2 } from "react";
|
|
701
731
|
import { jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
702
732
|
function Input({
|
|
703
733
|
onChange,
|
|
@@ -706,21 +736,29 @@ function Input({
|
|
|
706
736
|
className = "",
|
|
707
737
|
...props
|
|
708
738
|
}) {
|
|
709
|
-
const [inputType, setInputType] =
|
|
739
|
+
const [inputType, setInputType] = useState2(type);
|
|
740
|
+
const isDownMd = useDownMd();
|
|
710
741
|
return /* @__PURE__ */ jsxs24(
|
|
711
742
|
"div",
|
|
712
743
|
{
|
|
713
|
-
className: `matchid-input-box ${props.value.length > 0 ? "matchid-input-has-content" : ""} ${className}`,
|
|
744
|
+
className: `matchid-input-box ${props.value && props.value.length > 0 ? "matchid-input-has-content" : ""} ${className}`,
|
|
714
745
|
children: [
|
|
715
746
|
/* @__PURE__ */ jsx37("input", { type: inputType, onChange, ...props, className: "matchid-input-field" }),
|
|
716
|
-
props.value.length > 0 && /* @__PURE__ */ jsx37("div", { className: "matchid-input-delete-icon", onClick: (e) => {
|
|
747
|
+
props.value && props.value.length > 0 && /* @__PURE__ */ jsx37("div", { className: "matchid-input-delete-icon", onClick: (e) => {
|
|
717
748
|
if (onChange) {
|
|
718
749
|
onChange({ target: { value: "" } });
|
|
719
750
|
}
|
|
720
|
-
}, children: /* @__PURE__ */ jsx37(
|
|
751
|
+
}, children: /* @__PURE__ */ jsx37(
|
|
752
|
+
DeleteRoundIcon,
|
|
753
|
+
{
|
|
754
|
+
height: isDownMd ? 16 : 21,
|
|
755
|
+
width: isDownMd ? 16 : 20,
|
|
756
|
+
color: "var(--matchid-input-delete-icon-color)"
|
|
757
|
+
}
|
|
758
|
+
) }),
|
|
721
759
|
type === "password" && /* @__PURE__ */ jsx37("div", { className: "matchid-input-eye-icon", onClick: () => {
|
|
722
760
|
setInputType(inputType === "password" ? "text" : "password");
|
|
723
|
-
}, children: inputType === "password" ? /* @__PURE__ */ jsx37(CloseEyeIcon, {}) : /* @__PURE__ */ jsx37(OpenEyeIcon, {}) }),
|
|
761
|
+
}, children: inputType === "password" ? /* @__PURE__ */ jsx37(CloseEyeIcon, { size: isDownMd ? 16 : 20 }) : /* @__PURE__ */ jsx37(OpenEyeIcon, { size: isDownMd ? 16 : 20 }) }),
|
|
724
762
|
after
|
|
725
763
|
]
|
|
726
764
|
}
|
|
@@ -785,6 +823,7 @@ function Button({
|
|
|
785
823
|
var hooks_exports = {};
|
|
786
824
|
__export(hooks_exports, {
|
|
787
825
|
useCopyClipboard: () => useCopyClipboard,
|
|
826
|
+
useLayout: () => useLayout_exports,
|
|
788
827
|
useMatchEvents: () => useMatchEvents,
|
|
789
828
|
useUserInfo: () => useUserInfo,
|
|
790
829
|
useWallet: () => useWallet
|
|
@@ -1357,9 +1396,9 @@ function useUserInfo() {
|
|
|
1357
1396
|
}
|
|
1358
1397
|
|
|
1359
1398
|
// src/hooks/useMatchEvents.ts
|
|
1360
|
-
import { useEffect } from "react";
|
|
1399
|
+
import { useEffect as useEffect2 } from "react";
|
|
1361
1400
|
function useMatchEvents(handlers) {
|
|
1362
|
-
|
|
1401
|
+
useEffect2(() => {
|
|
1363
1402
|
Object.entries(handlers).forEach(([event, handler2]) => {
|
|
1364
1403
|
if (handler2) {
|
|
1365
1404
|
eventManager_default.on(event, handler2);
|
|
@@ -1523,14 +1562,14 @@ function useWallet() {
|
|
|
1523
1562
|
|
|
1524
1563
|
// src/hooks/useCopyClipboard.ts
|
|
1525
1564
|
import copy from "copy-to-clipboard";
|
|
1526
|
-
import { useCallback, useEffect as
|
|
1565
|
+
import { useCallback, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1527
1566
|
function useCopyClipboard(timeout = 500) {
|
|
1528
|
-
const [isCopied, setIsCopied] =
|
|
1567
|
+
const [isCopied, setIsCopied] = useState3(false);
|
|
1529
1568
|
const staticCopy = useCallback((text) => {
|
|
1530
1569
|
const didCopy = copy(text);
|
|
1531
1570
|
setIsCopied(didCopy);
|
|
1532
1571
|
}, []);
|
|
1533
|
-
|
|
1572
|
+
useEffect3(() => {
|
|
1534
1573
|
if (isCopied) {
|
|
1535
1574
|
const hide = setTimeout(() => {
|
|
1536
1575
|
setIsCopied(false);
|
|
@@ -1555,9 +1594,9 @@ function PasswordModal({
|
|
|
1555
1594
|
}) {
|
|
1556
1595
|
const { refreshOverview, overview } = useUserInfo();
|
|
1557
1596
|
const { isLogin, did } = useUserInfo();
|
|
1558
|
-
const [password, setPassword] =
|
|
1559
|
-
const [rePassword, setRePassword] =
|
|
1560
|
-
const [error, setError] =
|
|
1597
|
+
const [password, setPassword] = useState4("");
|
|
1598
|
+
const [rePassword, setRePassword] = useState4("");
|
|
1599
|
+
const [error, setError] = useState4("");
|
|
1561
1600
|
const { generateWallet, initWallet } = useWallet();
|
|
1562
1601
|
const intl = useIntl();
|
|
1563
1602
|
const passwordError = useMemo2(() => {
|
|
@@ -1576,7 +1615,7 @@ function PasswordModal({
|
|
|
1576
1615
|
}
|
|
1577
1616
|
return "";
|
|
1578
1617
|
}, [rePassword, password]);
|
|
1579
|
-
|
|
1618
|
+
useEffect4(() => {
|
|
1580
1619
|
if (isOpen && overview) {
|
|
1581
1620
|
setPassword("");
|
|
1582
1621
|
setRePassword("");
|
|
@@ -1587,7 +1626,7 @@ function PasswordModal({
|
|
|
1587
1626
|
});
|
|
1588
1627
|
}
|
|
1589
1628
|
}, [isOpen, overview]);
|
|
1590
|
-
const [isSubmitting, setIsSubmitting] =
|
|
1629
|
+
const [isSubmitting, setIsSubmitting] = useState4(false);
|
|
1591
1630
|
const onContinue = async () => {
|
|
1592
1631
|
if (isSubmitting) return;
|
|
1593
1632
|
try {
|
|
@@ -1653,7 +1692,7 @@ function PasswordModal({
|
|
|
1653
1692
|
}
|
|
1654
1693
|
|
|
1655
1694
|
// src/components/RecoveryModal/index.tsx
|
|
1656
|
-
import { useEffect as
|
|
1695
|
+
import { useEffect as useEffect5, useMemo as useMemo3, useState as useState5 } from "react";
|
|
1657
1696
|
import { FormattedMessage as FormattedMessage2, useIntl as useIntl2 } from "react-intl";
|
|
1658
1697
|
import { jsx as jsx41, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1659
1698
|
function RecoveryModal({
|
|
@@ -1664,9 +1703,9 @@ function RecoveryModal({
|
|
|
1664
1703
|
}) {
|
|
1665
1704
|
const { refreshOverview } = useUserInfo();
|
|
1666
1705
|
const { isLogin, overview } = useUserInfo();
|
|
1667
|
-
const [password, setPassword] =
|
|
1706
|
+
const [password, setPassword] = useState5("");
|
|
1668
1707
|
const { recoveryWallet, initWallet } = useWallet();
|
|
1669
|
-
const [error, setError] =
|
|
1708
|
+
const [error, setError] = useState5("");
|
|
1670
1709
|
const intl = useIntl2();
|
|
1671
1710
|
const passwordError = useMemo3(() => {
|
|
1672
1711
|
if (password.length < 6) return intl.formatMessage({
|
|
@@ -1676,7 +1715,7 @@ function RecoveryModal({
|
|
|
1676
1715
|
});
|
|
1677
1716
|
return "";
|
|
1678
1717
|
}, [password]);
|
|
1679
|
-
|
|
1718
|
+
useEffect5(() => {
|
|
1680
1719
|
if (isOpen && overview) {
|
|
1681
1720
|
setPassword("");
|
|
1682
1721
|
const did = overview.did.split(":")[2];
|
|
@@ -1686,7 +1725,7 @@ function RecoveryModal({
|
|
|
1686
1725
|
});
|
|
1687
1726
|
}
|
|
1688
1727
|
}, [isOpen, overview]);
|
|
1689
|
-
const [isSubmitting, setIsSubmitting] =
|
|
1728
|
+
const [isSubmitting, setIsSubmitting] = useState5(false);
|
|
1690
1729
|
const onContinue = async () => {
|
|
1691
1730
|
if (isSubmitting) return;
|
|
1692
1731
|
try {
|
|
@@ -1734,7 +1773,7 @@ function RecoveryModal({
|
|
|
1734
1773
|
}
|
|
1735
1774
|
|
|
1736
1775
|
// src/components/SOLModal/index.tsx
|
|
1737
|
-
import React2, { useEffect as
|
|
1776
|
+
import React2, { useEffect as useEffect10, useMemo as useMemo7, useState as useState14 } from "react";
|
|
1738
1777
|
|
|
1739
1778
|
// src/components/index.tsx
|
|
1740
1779
|
var components_exports = {};
|
|
@@ -1756,16 +1795,16 @@ __export(components_exports, {
|
|
|
1756
1795
|
});
|
|
1757
1796
|
|
|
1758
1797
|
// src/components/EmailModal/index.tsx
|
|
1759
|
-
import { useEffect as
|
|
1798
|
+
import { useEffect as useEffect8, useState as useState8 } from "react";
|
|
1760
1799
|
|
|
1761
1800
|
// src/components/EmailModal/StepEmail.tsx
|
|
1762
|
-
import { useEffect as
|
|
1801
|
+
import { useEffect as useEffect6, useMemo as useMemo4, useState as useState6 } from "react";
|
|
1763
1802
|
import { FormattedMessage as FormattedMessage3, useIntl as useIntl3 } from "react-intl";
|
|
1764
1803
|
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1765
1804
|
function StepEmail(props) {
|
|
1766
1805
|
const intl = useIntl3();
|
|
1767
|
-
const [emailVal, setEmailVal] =
|
|
1768
|
-
|
|
1806
|
+
const [emailVal, setEmailVal] = useState6("");
|
|
1807
|
+
useEffect6(() => {
|
|
1769
1808
|
if (props.email) {
|
|
1770
1809
|
setEmailVal(props.email);
|
|
1771
1810
|
}
|
|
@@ -1796,7 +1835,7 @@ function StepEmail(props) {
|
|
|
1796
1835
|
}
|
|
1797
1836
|
|
|
1798
1837
|
// src/components/EmailModal/StepVerify.tsx
|
|
1799
|
-
import { useEffect as
|
|
1838
|
+
import { useEffect as useEffect7, useMemo as useMemo5, useRef, useState as useState7 } from "react";
|
|
1800
1839
|
|
|
1801
1840
|
// src/config/index.tsx
|
|
1802
1841
|
var EMAIL_INTERVAL = 60;
|
|
@@ -1808,17 +1847,18 @@ import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
|
1808
1847
|
function StepVerify(props) {
|
|
1809
1848
|
const intl = useIntl4();
|
|
1810
1849
|
const { getLoginEmailCode, loginByEmail } = useUserInfo();
|
|
1811
|
-
const [error, setError] =
|
|
1812
|
-
const [code, setCode] =
|
|
1813
|
-
const [sending, setSending] =
|
|
1814
|
-
const [submitting, setSubmitting] =
|
|
1850
|
+
const [error, setError] = useState7("");
|
|
1851
|
+
const [code, setCode] = useState7("");
|
|
1852
|
+
const [sending, setSending] = useState7(false);
|
|
1853
|
+
const [submitting, setSubmitting] = useState7(false);
|
|
1815
1854
|
const sendTimeRef = useRef(0);
|
|
1816
|
-
const [sendBtnText, setSendBtnText] =
|
|
1855
|
+
const [sendBtnText, setSendBtnText] = useState7(intl.formatMessage({
|
|
1817
1856
|
id: "send"
|
|
1818
1857
|
}));
|
|
1819
1858
|
const intervalTime = EMAIL_INTERVAL;
|
|
1820
1859
|
const codeLength = EMAIL_CODE_LENGTH;
|
|
1821
1860
|
const intervalRef = useRef(null);
|
|
1861
|
+
const isDownMd = useDownMd();
|
|
1822
1862
|
const onSend = async () => {
|
|
1823
1863
|
if (sendTimeRef.current > 0) {
|
|
1824
1864
|
return;
|
|
@@ -1848,7 +1888,7 @@ function StepVerify(props) {
|
|
|
1848
1888
|
setSending(false);
|
|
1849
1889
|
}
|
|
1850
1890
|
};
|
|
1851
|
-
|
|
1891
|
+
useEffect7(() => {
|
|
1852
1892
|
onSend();
|
|
1853
1893
|
return () => {
|
|
1854
1894
|
if (intervalRef.current) {
|
|
@@ -1882,7 +1922,7 @@ function StepVerify(props) {
|
|
|
1882
1922
|
};
|
|
1883
1923
|
return /* @__PURE__ */ jsxs29("div", { className: "matchid-email-verify-box", children: [
|
|
1884
1924
|
/* @__PURE__ */ jsxs29("div", { className: "matchid-email-verify-header", children: [
|
|
1885
|
-
/* @__PURE__ */ jsx43("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ jsx43(EmailLineIcon, {}) }),
|
|
1925
|
+
/* @__PURE__ */ jsx43("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ jsx43(EmailLineIcon, { size: isDownMd ? 19 : 24 }) }),
|
|
1886
1926
|
/* @__PURE__ */ jsxs29("div", { className: "matchid-email-verify-header-content", children: [
|
|
1887
1927
|
/* @__PURE__ */ jsx43("div", { className: "matchid-email-verify-header-value", children: props.email }),
|
|
1888
1928
|
/* @__PURE__ */ jsx43("div", { className: "matchid-email-verify-header-tips", children: /* @__PURE__ */ jsx43(FormattedMessage4, { id: "sendEmailTips" }) })
|
|
@@ -1933,10 +1973,10 @@ function EmailModal({
|
|
|
1933
1973
|
onBack,
|
|
1934
1974
|
onLogin
|
|
1935
1975
|
}) {
|
|
1936
|
-
const [step, setStep] =
|
|
1937
|
-
const [emailVal, setEmailVal] =
|
|
1976
|
+
const [step, setStep] = useState8("input");
|
|
1977
|
+
const [emailVal, setEmailVal] = useState8("");
|
|
1938
1978
|
const intl = useIntl5();
|
|
1939
|
-
|
|
1979
|
+
useEffect8(() => {
|
|
1940
1980
|
if (!isOpen) {
|
|
1941
1981
|
setStep("input");
|
|
1942
1982
|
setEmailVal("");
|
|
@@ -1961,7 +2001,7 @@ function EmailModal({
|
|
|
1961
2001
|
}
|
|
1962
2002
|
|
|
1963
2003
|
// src/components/Popover/index.tsx
|
|
1964
|
-
import { useState as
|
|
2004
|
+
import { useState as useState9 } from "react";
|
|
1965
2005
|
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1966
2006
|
function Popover({
|
|
1967
2007
|
children,
|
|
@@ -1971,7 +2011,7 @@ function Popover({
|
|
|
1971
2011
|
className = "",
|
|
1972
2012
|
gap = "20px"
|
|
1973
2013
|
}) {
|
|
1974
|
-
const [active, setActive] =
|
|
2014
|
+
const [active, setActive] = useState9(false);
|
|
1975
2015
|
return /* @__PURE__ */ jsxs30(
|
|
1976
2016
|
"div",
|
|
1977
2017
|
{
|
|
@@ -1992,7 +2032,7 @@ function Popover({
|
|
|
1992
2032
|
}
|
|
1993
2033
|
|
|
1994
2034
|
// src/components/LoginBox/index.tsx
|
|
1995
|
-
import { useState as
|
|
2035
|
+
import { useState as useState10 } from "react";
|
|
1996
2036
|
import { FormattedMessage as FormattedMessage5, useIntl as useIntl6 } from "react-intl";
|
|
1997
2037
|
import { Fragment as Fragment2, jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1998
2038
|
var RecommendItem = ({
|
|
@@ -2046,75 +2086,76 @@ function LoginBox({
|
|
|
2046
2086
|
walletMethods = ["evm"],
|
|
2047
2087
|
inModal = false
|
|
2048
2088
|
}) {
|
|
2049
|
-
const [emailOpen, setEmailOpen] =
|
|
2089
|
+
const [emailOpen, setEmailOpen] = useState10(false);
|
|
2050
2090
|
const { login } = useUserInfo();
|
|
2051
|
-
const [showWallet, setShowWallet] =
|
|
2091
|
+
const [showWallet, setShowWallet] = useState10(false);
|
|
2052
2092
|
const intl = useIntl6();
|
|
2093
|
+
const isDownMd = useDownMd();
|
|
2053
2094
|
const methodMap = {
|
|
2054
2095
|
wallet: {
|
|
2055
|
-
icon: /* @__PURE__ */ jsx46(WalletIcon, {}),
|
|
2096
|
+
icon: /* @__PURE__ */ jsx46(WalletIcon, { size: isDownMd ? 36 : 40 }),
|
|
2056
2097
|
name: intl.formatMessage({ id: "wallet" }),
|
|
2057
2098
|
onClick: () => setShowWallet(!showWallet),
|
|
2058
2099
|
type: "wallet"
|
|
2059
2100
|
},
|
|
2060
2101
|
email: {
|
|
2061
|
-
icon: /* @__PURE__ */ jsx46(EmailIcon, {}),
|
|
2102
|
+
icon: /* @__PURE__ */ jsx46(EmailIcon, { size: isDownMd ? 36 : 40 }),
|
|
2062
2103
|
name: intl.formatMessage({ id: "email" }),
|
|
2063
2104
|
onClick: () => {
|
|
2064
2105
|
setEmailOpen(true);
|
|
2065
2106
|
}
|
|
2066
2107
|
},
|
|
2067
2108
|
google: {
|
|
2068
|
-
icon: /* @__PURE__ */ jsx46(GoogleIcon, {}),
|
|
2109
|
+
icon: /* @__PURE__ */ jsx46(GoogleIcon, { size: isDownMd ? 36 : 40 }),
|
|
2069
2110
|
name: "Google",
|
|
2070
2111
|
onClick: () => login("google")
|
|
2071
2112
|
},
|
|
2072
2113
|
twitter: {
|
|
2073
|
-
icon: /* @__PURE__ */ jsx46(XIcon, {}),
|
|
2114
|
+
icon: /* @__PURE__ */ jsx46(XIcon, { size: isDownMd ? 36 : 40 }),
|
|
2074
2115
|
name: "X",
|
|
2075
2116
|
onClick: () => login("twitter")
|
|
2076
2117
|
},
|
|
2077
2118
|
telegram: {
|
|
2078
|
-
icon: /* @__PURE__ */ jsx46(TelegramIcon, {}),
|
|
2119
|
+
icon: /* @__PURE__ */ jsx46(TelegramIcon, { size: isDownMd ? 36 : 40 }),
|
|
2079
2120
|
name: "Telegram",
|
|
2080
2121
|
onClick: () => login("telegram")
|
|
2081
2122
|
},
|
|
2082
2123
|
github: {
|
|
2083
|
-
icon: /* @__PURE__ */ jsx46(GithubIcon, {}),
|
|
2124
|
+
icon: /* @__PURE__ */ jsx46(GithubIcon, { size: isDownMd ? 36 : 40 }),
|
|
2084
2125
|
name: "Github",
|
|
2085
2126
|
onClick: () => login("github")
|
|
2086
2127
|
},
|
|
2087
2128
|
discord: {
|
|
2088
|
-
icon: /* @__PURE__ */ jsx46(DiscordIcon, {}),
|
|
2129
|
+
icon: /* @__PURE__ */ jsx46(DiscordIcon, { size: isDownMd ? 36 : 40 }),
|
|
2089
2130
|
name: "Discord",
|
|
2090
2131
|
onClick: () => login("discord")
|
|
2091
2132
|
},
|
|
2092
2133
|
linkedin: {
|
|
2093
|
-
icon: /* @__PURE__ */ jsx46(LinkedinIcon, {}),
|
|
2134
|
+
icon: /* @__PURE__ */ jsx46(LinkedinIcon, { size: isDownMd ? 36 : 40 }),
|
|
2094
2135
|
name: "LinkedIn",
|
|
2095
2136
|
onClick: () => login("linkedin")
|
|
2096
2137
|
},
|
|
2097
2138
|
facebook: {
|
|
2098
|
-
icon: /* @__PURE__ */ jsx46(FacebookIcon, {}),
|
|
2139
|
+
icon: /* @__PURE__ */ jsx46(FacebookIcon, { size: isDownMd ? 36 : 40 }),
|
|
2099
2140
|
name: "Facebook",
|
|
2100
2141
|
onClick: () => login("facebook")
|
|
2101
2142
|
},
|
|
2102
2143
|
youtube: {
|
|
2103
|
-
icon: /* @__PURE__ */ jsx46(YoutubeIcon, {}),
|
|
2144
|
+
icon: /* @__PURE__ */ jsx46(YoutubeIcon, { size: isDownMd ? 36 : 40 }),
|
|
2104
2145
|
name: "Youtube",
|
|
2105
2146
|
onClick: () => login("youtube")
|
|
2106
2147
|
}
|
|
2107
2148
|
};
|
|
2108
2149
|
const walletMap = {
|
|
2109
2150
|
evm: {
|
|
2110
|
-
icon: /* @__PURE__ */ jsx46(EVMDarkIcon, {}),
|
|
2111
|
-
activeIcon: /* @__PURE__ */ jsx46(EVMLightIcon, {}),
|
|
2151
|
+
icon: /* @__PURE__ */ jsx46(EVMDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2152
|
+
activeIcon: /* @__PURE__ */ jsx46(EVMLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2112
2153
|
name: "EVM",
|
|
2113
2154
|
onClick: () => login("evm")
|
|
2114
2155
|
},
|
|
2115
2156
|
sol: {
|
|
2116
|
-
icon: /* @__PURE__ */ jsx46(SOLDarkIcon, {}),
|
|
2117
|
-
activeIcon: /* @__PURE__ */ jsx46(SOLLightIcon, {}),
|
|
2157
|
+
icon: /* @__PURE__ */ jsx46(SOLDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2158
|
+
activeIcon: /* @__PURE__ */ jsx46(SOLLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2118
2159
|
name: "SOL",
|
|
2119
2160
|
onClick: () => login("sol")
|
|
2120
2161
|
}
|
|
@@ -2206,7 +2247,7 @@ function LoginBox({
|
|
|
2206
2247
|
}
|
|
2207
2248
|
|
|
2208
2249
|
// src/components/LoginButton/index.tsx
|
|
2209
|
-
import { useState as
|
|
2250
|
+
import { useState as useState12 } from "react";
|
|
2210
2251
|
|
|
2211
2252
|
// src/components/LoginPanel/index.tsx
|
|
2212
2253
|
import { FormattedMessage as FormattedMessage6 } from "react-intl";
|
|
@@ -2216,13 +2257,14 @@ function LoginPanel({
|
|
|
2216
2257
|
onClose,
|
|
2217
2258
|
...props
|
|
2218
2259
|
}) {
|
|
2260
|
+
const isDownMd = useDownMd();
|
|
2219
2261
|
return /* @__PURE__ */ jsxs32("div", { className: "matchid-login-panel", children: [
|
|
2220
2262
|
header ? header : /* @__PURE__ */ jsxs32("div", { className: "matchid-login-panel-header", children: [
|
|
2221
2263
|
/* @__PURE__ */ jsxs32("div", { className: "matchid-login-panel-header-content", children: [
|
|
2222
2264
|
/* @__PURE__ */ jsx47("div", { className: "matchid-login-panel-header-title", children: /* @__PURE__ */ jsx47(FormattedMessage6, { id: "loginTitle" }) }),
|
|
2223
2265
|
/* @__PURE__ */ jsx47("div", { className: "matchid-login-panel-header-subtilte", children: /* @__PURE__ */ jsx47(FormattedMessage6, { id: "loginTips" }) })
|
|
2224
2266
|
] }),
|
|
2225
|
-
onClose && /* @__PURE__ */ jsx47("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ jsx47(CloseRoundIcon, {}) })
|
|
2267
|
+
onClose && /* @__PURE__ */ jsx47("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ jsx47(CloseRoundIcon, { size: isDownMd ? 24 : 30 }) })
|
|
2226
2268
|
] }),
|
|
2227
2269
|
/* @__PURE__ */ jsx47("div", { className: "matchid-login-panel-divide" }),
|
|
2228
2270
|
/* @__PURE__ */ jsx47("div", { className: "matchid-login-panel-box", children: /* @__PURE__ */ jsx47(LoginBox, { ...props }) })
|
|
@@ -2248,7 +2290,7 @@ function LoginModal({
|
|
|
2248
2290
|
}
|
|
2249
2291
|
|
|
2250
2292
|
// src/components/UserPopover/index.tsx
|
|
2251
|
-
import { useState as
|
|
2293
|
+
import { useState as useState11 } from "react";
|
|
2252
2294
|
|
|
2253
2295
|
// src/assets/icon/ProfileIcon.tsx
|
|
2254
2296
|
import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
@@ -2280,7 +2322,7 @@ import { FormattedMessage as FormattedMessage7, useIntl as useIntl7 } from "reac
|
|
|
2280
2322
|
import { jsx as jsx50, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2281
2323
|
function UserContent() {
|
|
2282
2324
|
const { logout, address, username } = useUserInfo();
|
|
2283
|
-
const [logouting, setLogouting] =
|
|
2325
|
+
const [logouting, setLogouting] = useState11(false);
|
|
2284
2326
|
const onLogout = async () => {
|
|
2285
2327
|
if (logouting) return;
|
|
2286
2328
|
try {
|
|
@@ -2309,7 +2351,7 @@ function UserContent() {
|
|
|
2309
2351
|
const UserDivider = () => {
|
|
2310
2352
|
return /* @__PURE__ */ jsx50("div", { className: `matchid-user-popover-divider` });
|
|
2311
2353
|
};
|
|
2312
|
-
const [usernameOpen, setUsernameOpen] =
|
|
2354
|
+
const [usernameOpen, setUsernameOpen] = useState11(false);
|
|
2313
2355
|
const [copied, setCopied] = useCopyClipboard();
|
|
2314
2356
|
const intl = useIntl7();
|
|
2315
2357
|
return /* @__PURE__ */ jsxs34("div", { className: "matchid-user-popover-content", children: [
|
|
@@ -2355,7 +2397,7 @@ function LoginButton({
|
|
|
2355
2397
|
}) {
|
|
2356
2398
|
const intl = useIntl8();
|
|
2357
2399
|
const { isLogin, username } = useUserInfo();
|
|
2358
|
-
const [loginOpen, setLoginOpen] =
|
|
2400
|
+
const [loginOpen, setLoginOpen] = useState12(false);
|
|
2359
2401
|
if (!isLogin) {
|
|
2360
2402
|
return /* @__PURE__ */ jsxs35(Fragment3, { children: [
|
|
2361
2403
|
/* @__PURE__ */ jsx51(
|
|
@@ -2383,7 +2425,7 @@ function LoginButton({
|
|
|
2383
2425
|
}
|
|
2384
2426
|
|
|
2385
2427
|
// src/components/UsernameModal/index.tsx
|
|
2386
|
-
import { useEffect as
|
|
2428
|
+
import { useEffect as useEffect9, useMemo as useMemo6, useState as useState13 } from "react";
|
|
2387
2429
|
|
|
2388
2430
|
// src/assets/icon/InfoRoundIcon.tsx
|
|
2389
2431
|
import { jsx as jsx52, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
@@ -2413,8 +2455,9 @@ var ValidItem = ({
|
|
|
2413
2455
|
success = false,
|
|
2414
2456
|
text
|
|
2415
2457
|
}) => {
|
|
2458
|
+
const isDownMd = useDownMd();
|
|
2416
2459
|
return /* @__PURE__ */ jsxs37("div", { className: `matchid-valid-status-item matchid-valid-status-${success ? "success" : "error"}`, children: [
|
|
2417
|
-
success ? /* @__PURE__ */ jsx53(CheckRoundIcon, { size: 16 }) : /* @__PURE__ */ jsx53(InfoRoundIcon, { size: 16 }),
|
|
2460
|
+
success ? /* @__PURE__ */ jsx53(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ jsx53(InfoRoundIcon, { size: isDownMd ? 12 : 16 }),
|
|
2418
2461
|
/* @__PURE__ */ jsx53("span", { children: text })
|
|
2419
2462
|
] });
|
|
2420
2463
|
};
|
|
@@ -2426,9 +2469,10 @@ function UsernameModal({
|
|
|
2426
2469
|
}) {
|
|
2427
2470
|
const { username, refreshOverview } = useUserInfo();
|
|
2428
2471
|
const { isLogin } = useUserInfo();
|
|
2429
|
-
const [val, setVal] =
|
|
2430
|
-
const [error, setError] =
|
|
2431
|
-
|
|
2472
|
+
const [val, setVal] = useState13(username);
|
|
2473
|
+
const [error, setError] = useState13("");
|
|
2474
|
+
const isDownMd = useDownMd();
|
|
2475
|
+
useEffect9(() => {
|
|
2432
2476
|
if (isOpen) {
|
|
2433
2477
|
setVal(username);
|
|
2434
2478
|
setError("");
|
|
@@ -2441,7 +2485,7 @@ function UsernameModal({
|
|
|
2441
2485
|
return val.length >= 2 && val.length <= 32;
|
|
2442
2486
|
}, [val]);
|
|
2443
2487
|
const isSafe = isValid && isLength;
|
|
2444
|
-
const [isSubmitting, setIsSubmitting] =
|
|
2488
|
+
const [isSubmitting, setIsSubmitting] = useState13(false);
|
|
2445
2489
|
const onSubmit = async () => {
|
|
2446
2490
|
if (isSubmitting) return;
|
|
2447
2491
|
try {
|
|
@@ -2495,10 +2539,10 @@ function UsernameModal({
|
|
|
2495
2539
|
}) })
|
|
2496
2540
|
] }),
|
|
2497
2541
|
/* @__PURE__ */ jsx53(Button, { disabled: !isSafe, loading: isSubmitting, style: {
|
|
2498
|
-
marginTop: "64px"
|
|
2542
|
+
marginTop: isDownMd ? "36px" : "64px"
|
|
2499
2543
|
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ jsx53(FormattedMessage9, { id: "confirm" }) }),
|
|
2500
2544
|
/* @__PURE__ */ jsx53(Button, { style: {
|
|
2501
|
-
marginTop: "24px"
|
|
2545
|
+
marginTop: isDownMd ? "12px" : "24px"
|
|
2502
2546
|
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ jsx53(FormattedMessage9, { id: "nextTime" }) })
|
|
2503
2547
|
] }) });
|
|
2504
2548
|
}
|
|
@@ -2572,17 +2616,17 @@ function WalletContent({
|
|
|
2572
2616
|
const { setVisible, visible } = useWalletModal();
|
|
2573
2617
|
const wallet = useWallet2();
|
|
2574
2618
|
const { events, login } = useMatch();
|
|
2575
|
-
const [status, setStatus] =
|
|
2619
|
+
const [status, setStatus] = useState14("");
|
|
2576
2620
|
const statusRef = React2.useRef(status);
|
|
2577
|
-
const [error, setError] =
|
|
2578
|
-
|
|
2621
|
+
const [error, setError] = useState14("");
|
|
2622
|
+
useEffect10(() => {
|
|
2579
2623
|
const init = async () => {
|
|
2580
2624
|
await wallet.disconnect();
|
|
2581
2625
|
setVisible(true);
|
|
2582
2626
|
};
|
|
2583
2627
|
init();
|
|
2584
2628
|
}, []);
|
|
2585
|
-
|
|
2629
|
+
useEffect10(() => {
|
|
2586
2630
|
if (wallet.connected) {
|
|
2587
2631
|
console.log("wallet.connected", wallet.connected);
|
|
2588
2632
|
toLoginInWallet();
|
|
@@ -2810,7 +2854,7 @@ var Providers = ({ children }) => {
|
|
|
2810
2854
|
var context_default = Providers;
|
|
2811
2855
|
|
|
2812
2856
|
// src/hooks/useWalletInit.ts
|
|
2813
|
-
import { useEffect as
|
|
2857
|
+
import { useEffect as useEffect11, useState as useState15 } from "react";
|
|
2814
2858
|
var AppClientId2 = getAppClientId();
|
|
2815
2859
|
function useWalletInit({
|
|
2816
2860
|
refreshOverview
|
|
@@ -2819,10 +2863,10 @@ function useWalletInit({
|
|
|
2819
2863
|
const getWalletIframe = () => {
|
|
2820
2864
|
return document.getElementById("match-wallet");
|
|
2821
2865
|
};
|
|
2822
|
-
const [walletInited, setWalletInited] =
|
|
2866
|
+
const [walletInited, setWalletInited] = useState15(false);
|
|
2823
2867
|
const { appid, token, overview } = useLocalStore_default();
|
|
2824
2868
|
const { initWallet, generateWallet } = useWallet();
|
|
2825
|
-
|
|
2869
|
+
useEffect11(() => {
|
|
2826
2870
|
if (endpoints.auth) {
|
|
2827
2871
|
if (!window.matchWalletMessageIdMap) {
|
|
2828
2872
|
window.matchWalletMessageIdMap = {};
|
|
@@ -2880,7 +2924,7 @@ function useWalletInit({
|
|
|
2880
2924
|
}
|
|
2881
2925
|
}
|
|
2882
2926
|
}, [endpoints.auth]);
|
|
2883
|
-
|
|
2927
|
+
useEffect11(() => {
|
|
2884
2928
|
const messageHandle = async (e) => {
|
|
2885
2929
|
if (e.origin !== endpoints.auth.substring(0, endpoints.auth.length - 1)) {
|
|
2886
2930
|
return;
|
|
@@ -2913,7 +2957,7 @@ function useWalletInit({
|
|
|
2913
2957
|
window.removeEventListener("message", messageHandle);
|
|
2914
2958
|
};
|
|
2915
2959
|
}, []);
|
|
2916
|
-
|
|
2960
|
+
useEffect11(() => {
|
|
2917
2961
|
if (token && overview && overview.did && walletInited) {
|
|
2918
2962
|
const did = overview.did.split(":")[2];
|
|
2919
2963
|
const newUserInit = async () => {
|
|
@@ -2944,7 +2988,7 @@ function useWalletInit({
|
|
|
2944
2988
|
}
|
|
2945
2989
|
|
|
2946
2990
|
// src/hooks/useInit.tsx
|
|
2947
|
-
import { useEffect as
|
|
2991
|
+
import { useEffect as useEffect12, useRef as useRef2 } from "react";
|
|
2948
2992
|
function useInit({
|
|
2949
2993
|
theme,
|
|
2950
2994
|
appid,
|
|
@@ -2967,19 +3011,19 @@ function useInit({
|
|
|
2967
3011
|
const searchParams = new URLSearchParams(window.location.search);
|
|
2968
3012
|
const matchToken = searchParams.get("matchToken");
|
|
2969
3013
|
const realEndpoints = endpoints || env_default.endpoints;
|
|
2970
|
-
|
|
3014
|
+
useEffect12(() => {
|
|
2971
3015
|
setTheme(theme);
|
|
2972
3016
|
}, [theme]);
|
|
2973
|
-
|
|
3017
|
+
useEffect12(() => {
|
|
2974
3018
|
setAppid(appid);
|
|
2975
3019
|
}, [appid]);
|
|
2976
|
-
|
|
3020
|
+
useEffect12(() => {
|
|
2977
3021
|
setEndpoints(realEndpoints);
|
|
2978
3022
|
}, [realEndpoints]);
|
|
2979
|
-
|
|
3023
|
+
useEffect12(() => {
|
|
2980
3024
|
setLocale(locale || "en");
|
|
2981
3025
|
}, [locale]);
|
|
2982
|
-
|
|
3026
|
+
useEffect12(() => {
|
|
2983
3027
|
if (matchToken) {
|
|
2984
3028
|
const tokenData = JSON.parse(atob(matchToken));
|
|
2985
3029
|
if (tokenData && tokenData.mid && tokenData.token) {
|
|
@@ -2990,7 +3034,7 @@ function useInit({
|
|
|
2990
3034
|
}
|
|
2991
3035
|
}
|
|
2992
3036
|
}, [matchToken]);
|
|
2993
|
-
|
|
3037
|
+
useEffect12(() => {
|
|
2994
3038
|
const onLoginMessage = (event) => {
|
|
2995
3039
|
const res = event.data;
|
|
2996
3040
|
if (res.event === "login" && res.data && (res.data.token || res.data.token_type && res.data.access_token)) {
|
|
@@ -3026,7 +3070,7 @@ function useInit({
|
|
|
3026
3070
|
overviewLoadingRef.current = false;
|
|
3027
3071
|
}
|
|
3028
3072
|
};
|
|
3029
|
-
|
|
3073
|
+
useEffect12(() => {
|
|
3030
3074
|
if (token) {
|
|
3031
3075
|
loadOverview();
|
|
3032
3076
|
}
|