@web3auth/modal 11.0.0-beta.0 → 11.0.0-beta.2
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/README.md +4 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/react.js +22 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/vue.js +22 -0
- package/dist/lib.cjs/packages/modal/src/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +446 -26
- package/dist/lib.cjs/packages/modal/src/react/index.js +7 -3
- package/dist/lib.cjs/packages/modal/src/react/wagmi/provider.js +27 -12
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +28 -28
- package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +19 -19
- package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
- package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/config.js +3 -1
- package/dist/lib.cjs/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +109 -0
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
- package/dist/lib.cjs/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/Login.js +48 -42
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +24 -9
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
- package/dist/lib.cjs/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
- package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +1 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +26 -0
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +113 -4
- package/dist/lib.cjs/packages/modal/src/vue/index.js +7 -3
- package/dist/lib.cjs/packages/modal/src/vue/wagmi/provider.js +27 -14
- package/dist/lib.cjs/types/account-linking/index.d.ts +1 -0
- package/dist/lib.cjs/types/account-linking/react.d.ts +2 -0
- package/dist/lib.cjs/types/account-linking/vue.d.ts +2 -0
- package/dist/lib.cjs/types/modalManager.d.ts +40 -2
- package/dist/lib.cjs/types/react/hooks/index.d.ts +1 -0
- package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +2 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/AccountLinking.d.ts +6 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/Root/Root.d.ts +1 -1
- package/dist/lib.cjs/types/ui/interfaces.d.ts +43 -8
- package/dist/lib.cjs/types/ui/loginModal.d.ts +27 -2
- package/dist/lib.cjs/types/ui/utils.d.ts +1 -1
- package/dist/lib.cjs/types/vue/composables/index.d.ts +1 -0
- package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +2 -0
- package/dist/lib.esm/packages/modal/src/account-linking/index.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/react.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/vue.js +1 -0
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +451 -28
- package/dist/lib.esm/packages/modal/src/react/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/react/wagmi/provider.js +28 -13
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +28 -28
- package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +19 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
- package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/config.js +3 -1
- package/dist/lib.esm/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +107 -0
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
- package/dist/lib.esm/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/Login.js +49 -43
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +24 -9
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
- package/dist/lib.esm/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
- package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +2 -1
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +24 -1
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +115 -6
- package/dist/lib.esm/packages/modal/src/vue/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/vue/wagmi/provider.js +28 -15
- package/package.json +43 -20
|
@@ -51,12 +51,12 @@ function ConnectWalletQrCode(props) {
|
|
|
51
51
|
const modalColor = ((_getComputedStyle = getComputedStyle(root)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.getPropertyValue("--app-gray-800")) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.trim()) || "#1f2a37";
|
|
52
52
|
const qrColor = primaryColor && primaryColor.toLowerCase() === "#ffffff" ? "#000000" : primaryColor;
|
|
53
53
|
return jsxRuntime.jsxs("div", {
|
|
54
|
-
className: "
|
|
54
|
+
className: "wta:contents",
|
|
55
55
|
children: [qrCodeValue ? jsxRuntime.jsxs("div", {
|
|
56
|
-
className: "
|
|
56
|
+
className: "wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-4 wta:rounded-2xl wta:border wta:border-app-gray-200 wta:p-4 wta:dark:border-app-gray-700",
|
|
57
57
|
children: [jsxRuntime.jsx("button", {
|
|
58
58
|
type: "button",
|
|
59
|
-
className: "
|
|
59
|
+
className: "wta:relative wta:flex wta:size-[300px] wta:appearance-none wta:items-center wta:justify-center wta:rounded-2xl",
|
|
60
60
|
onClick: () => {
|
|
61
61
|
navigator.clipboard.writeText(qrCodeValue);
|
|
62
62
|
setToast({
|
|
@@ -79,11 +79,11 @@ function ConnectWalletQrCode(props) {
|
|
|
79
79
|
fgColor: isDark ? whiteColor : blackColor
|
|
80
80
|
})
|
|
81
81
|
}), jsxRuntime.jsx("p", {
|
|
82
|
-
className: "
|
|
82
|
+
className: "wta:text-center wta:text-sm wta:font-normal wta:text-app-gray-500 wta:dark:text-app-gray-300",
|
|
83
83
|
children: t("modal.external.walletconnect-copy")
|
|
84
84
|
})]
|
|
85
85
|
}) : jsxRuntime.jsx("div", {
|
|
86
|
-
className: "
|
|
86
|
+
className: "wta:mx-auto wta:flex wta:size-[300px] wta:animate-pulse wta:items-center wta:justify-center wta:rounded-lg wta:bg-app-gray-200 wta:p-2 wta:dark:bg-app-gray-700",
|
|
87
87
|
children: jsxRuntime.jsx(Image, {
|
|
88
88
|
imageId: `login-${selectedButton.name}`,
|
|
89
89
|
hoverImageId: `login-${selectedButton.name}`,
|
|
@@ -94,15 +94,15 @@ function ConnectWalletQrCode(props) {
|
|
|
94
94
|
extension: selectedButton.imgExtension
|
|
95
95
|
})
|
|
96
96
|
}), showGetWalletComponent && jsxRuntime.jsxs("div", {
|
|
97
|
-
className: "
|
|
97
|
+
className: "wta:flex wta:w-full wta:items-center wta:justify-between wta:rounded-2xl wta:bg-app-gray-50 \n wta:px-4 wta:py-2 wta:text-app-gray-900 wta:dark:bg-app-gray-800 wta:dark:text-app-white",
|
|
98
98
|
children: [jsxRuntime.jsxs("p", {
|
|
99
|
-
className: "
|
|
99
|
+
className: "wta:text-sm wta:text-app-gray-900 wta:dark:text-app-white",
|
|
100
100
|
children: [t("modal.external.dont-have"), " ", jsxRuntime.jsx("span", {
|
|
101
101
|
children: selectedButton === null || selectedButton === void 0 ? void 0 : selectedButton.displayName
|
|
102
102
|
}), "?"]
|
|
103
103
|
}), jsxRuntime.jsx("button", {
|
|
104
104
|
type: "button",
|
|
105
|
-
className: "
|
|
105
|
+
className: "wta:appearance-none wta:rounded-full wta:border wta:border-app-gray-200 wta:bg-transparent wta:px-5 wta:py-2 wta:text-base wta:font-normal wta:text-app-gray-700 wta:transition-all wta:duration-150 wta:hover:border-transparent wta:hover:shadow-light wta:active:scale-95 wta:dark:border-app-gray-700 wta:dark:text-app-gray-300 wta:dark:hover:border-transparent wta:dark:hover:shadow-dark",
|
|
106
106
|
onClick: () => {
|
|
107
107
|
setBodyState(_objectSpread(_objectSpread({}, bodyState), {}, {
|
|
108
108
|
installLinks: {
|
|
@@ -30,7 +30,7 @@ function ConnectWalletSearch(props) {
|
|
|
30
30
|
};
|
|
31
31
|
// const isShowSearch = totalExternalWalletCount > 15 && !isLoading;
|
|
32
32
|
// if (!isShowSearch) {
|
|
33
|
-
// return <div className="
|
|
33
|
+
// return <div className="wta:h-[50px] wta:w-full wta:animate-pulse wta:rounded-full wta:bg-app-gray-200 wta:dark:bg-app-gray-700" />;
|
|
34
34
|
// }
|
|
35
35
|
return jsxRuntime.jsx("input", {
|
|
36
36
|
type: "text",
|
|
@@ -50,10 +50,10 @@ function ConnectWalletSearch(props) {
|
|
|
50
50
|
count: totalExternalWalletCount
|
|
51
51
|
}),
|
|
52
52
|
disabled: isLoading,
|
|
53
|
-
className: utils.cn("w3a--input
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
53
|
+
className: utils.cn("w3a--input wta:appearance-none wta:outline-none wta:active:outline-none wta:focus:outline-none wta:bg-transparent wta:placeholder:text-app-gray-400 wta:dark:placeholder:text-app-gray-500 wta:text-app-gray-900 wta:dark:text-app-white", isInputFocused && "wta:border-app-primary-600!", {
|
|
54
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
55
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
56
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -37,18 +37,18 @@ function Embed(props) {
|
|
|
37
37
|
};
|
|
38
38
|
if (!isOpen) return null;
|
|
39
39
|
return jsxRuntime.jsxs("div", {
|
|
40
|
-
className: utils.cn("
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
40
|
+
className: utils.cn("wta:bg-app-light-surface1 wta:dark:bg-app-dark-surface-main wta:rounded-3xl wta:w-[356px] wta:[@media(min-width:375px)]:w-[393px] wta:h-auto wta:flex wta:flex-col wta:duration-500", {
|
|
41
|
+
"wta:translate-y-0 wta:delay-100": isOpen,
|
|
42
|
+
"wta:translate-y-[100vh]": !isOpen,
|
|
43
|
+
"wta:p-4": padding,
|
|
44
|
+
"wta:shadow-xl wta:sm:shadow-lg": shadow,
|
|
45
|
+
"wta:border wta:border-app-gray-100 wta:dark:border-app-gray-800": border,
|
|
46
|
+
"wta:rounded-[30px]": borderRadius === "large",
|
|
47
|
+
"wta:rounded-2xl": borderRadius === "medium",
|
|
48
|
+
"wta:rounded-none": borderRadius === "small"
|
|
49
49
|
}),
|
|
50
50
|
children: [showCloseIcon && jsxRuntime.jsx("div", {
|
|
51
|
-
className: "
|
|
51
|
+
className: "wta:absolute wta:right-6 wta:top-[30px] wta:z-10 wta:cursor-pointer",
|
|
52
52
|
children: jsxRuntime.jsx("svg", {
|
|
53
53
|
width: "13",
|
|
54
54
|
height: "13",
|
|
@@ -56,7 +56,7 @@ function Embed(props) {
|
|
|
56
56
|
fill: "none",
|
|
57
57
|
xmlns: "http://www.w3.org/2000/svg",
|
|
58
58
|
onClick: onCloseHandler,
|
|
59
|
-
className: "
|
|
59
|
+
className: "wta:text-app-gray-900 wta:dark:text-app-white",
|
|
60
60
|
children: jsxRuntime.jsx("path", {
|
|
61
61
|
fillRule: "evenodd",
|
|
62
62
|
clipRule: "evenodd",
|
|
@@ -22,7 +22,9 @@ var utils = require('../../utils.js');
|
|
|
22
22
|
var LoginOtp = require('./LoginOtp/LoginOtp.js');
|
|
23
23
|
var LoginPasswordLess = require('./LoginPasswordLess/LoginPasswordLess.js');
|
|
24
24
|
|
|
25
|
-
const restrictedLoginMethods = [auth.AUTH_CONNECTION.SMS_PASSWORDLESS, auth.AUTH_CONNECTION.EMAIL_PASSWORDLESS, auth.AUTH_CONNECTION.AUTHENTICATOR, auth.AUTH_CONNECTION.PASSKEYS, auth.AUTH_CONNECTION.TELEGRAM, auth.AUTH_CONNECTION.CUSTOM
|
|
25
|
+
const restrictedLoginMethods = [auth.AUTH_CONNECTION.SMS_PASSWORDLESS, auth.AUTH_CONNECTION.EMAIL_PASSWORDLESS, auth.AUTH_CONNECTION.AUTHENTICATOR, auth.AUTH_CONNECTION.PASSKEYS, auth.AUTH_CONNECTION.TELEGRAM, auth.AUTH_CONNECTION.CUSTOM,
|
|
26
|
+
// Farcaster login is deprecated and no longer supported by the Web3Auth SDKs.
|
|
27
|
+
auth.AUTH_CONNECTION.FARCASTER];
|
|
26
28
|
function Login(props) {
|
|
27
29
|
const {
|
|
28
30
|
installedExternalWalletConfig,
|
|
@@ -76,10 +78,6 @@ function Login(props) {
|
|
|
76
78
|
const [passwordlessErrorMessage, setPasswordlessErrorMessage] = react.useState("");
|
|
77
79
|
const [otpErrorMessage, setOtpErrorMessage] = react.useState("");
|
|
78
80
|
const [expandSocialLogins, setExpandSocialLogins] = react.useState(false);
|
|
79
|
-
const [canShowMore, setCanShowMore] = react.useState(false);
|
|
80
|
-
const [visibleRow, setVisibleRow] = react.useState([]);
|
|
81
|
-
const [otherRow, setOtherRow] = react.useState([]);
|
|
82
|
-
const [mainOptionsRow, setMainOptionsRow] = react.useState([]);
|
|
83
81
|
const [isPasswordLessCtaClicked, setIsPasswordLessCtaClicked] = react.useState(false);
|
|
84
82
|
const [showOtpFlow, setShowOtpFlow] = react.useState(false);
|
|
85
83
|
const [authConnection, setAuthConnection] = react.useState(undefined);
|
|
@@ -93,7 +91,12 @@ function Login(props) {
|
|
|
93
91
|
setExpandSocialLogins(prev => !prev);
|
|
94
92
|
setIsPasswordLessCtaClicked(false);
|
|
95
93
|
};
|
|
96
|
-
|
|
94
|
+
const {
|
|
95
|
+
visibleRow,
|
|
96
|
+
otherRow,
|
|
97
|
+
mainOptionsRow,
|
|
98
|
+
canShowMore
|
|
99
|
+
} = react.useMemo(() => {
|
|
97
100
|
const maxOptions = Object.keys(socialLoginsConfig.loginMethods).filter(loginMethodKey => {
|
|
98
101
|
return socialLoginsConfig.loginMethods[loginMethodKey].showOnModal && !restrictedLoginMethods.includes(loginMethodKey);
|
|
99
102
|
});
|
|
@@ -160,11 +163,13 @@ function Login(props) {
|
|
|
160
163
|
}
|
|
161
164
|
otherRows.push(rows);
|
|
162
165
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
return {
|
|
167
|
+
visibleRow: visibleRows,
|
|
168
|
+
otherRow: otherRows,
|
|
169
|
+
mainOptionsRow: mainOptionsRows,
|
|
170
|
+
canShowMore: maxOptions.length > 4
|
|
171
|
+
};
|
|
172
|
+
}, [socialLoginsConfig, isDark]);
|
|
168
173
|
const handleCustomLogin = async (authConnection, loginHint) => {
|
|
169
174
|
try {
|
|
170
175
|
const handler = factory.createPasswordlessHandler(authConnection, {
|
|
@@ -247,7 +252,7 @@ function Login(props) {
|
|
|
247
252
|
}
|
|
248
253
|
}
|
|
249
254
|
}
|
|
250
|
-
setPasswordlessErrorMessage(
|
|
255
|
+
setPasswordlessErrorMessage(getInvalidInputErrorMessage());
|
|
251
256
|
setIsPasswordLessLoading(false);
|
|
252
257
|
return undefined;
|
|
253
258
|
};
|
|
@@ -261,11 +266,11 @@ function Login(props) {
|
|
|
261
266
|
if (isEmailPasswordLessLoginVisible) return "name@example.com";
|
|
262
267
|
return "+(00)123456";
|
|
263
268
|
}, [isEmailPasswordLessLoginVisible, isSmsPasswordLessLoginVisible]);
|
|
264
|
-
const
|
|
269
|
+
const getInvalidInputErrorMessage = () => {
|
|
265
270
|
if (isEmailPasswordLessLoginVisible && isSmsPasswordLessLoginVisible) return t("modal.errors-invalid-number-email");
|
|
266
271
|
if (isEmailPasswordLessLoginVisible) return t("modal.errors-invalid-email");
|
|
267
272
|
return t("modal.errors-invalid-number");
|
|
268
|
-
}
|
|
273
|
+
};
|
|
269
274
|
react.useEffect(() => {
|
|
270
275
|
const getLocation = async () => {
|
|
271
276
|
const result = await utils.getUserCountry();
|
|
@@ -375,6 +380,7 @@ function Login(props) {
|
|
|
375
380
|
}, [analytics, handleExternalWalletBtnClick, installedExternalWallets.length, totalExternalWallets]);
|
|
376
381
|
react.useEffect(() => {
|
|
377
382
|
if (showExternalWalletButton && !areSocialLoginsVisible && !showPasswordLessInput) {
|
|
383
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect -- intentional
|
|
378
384
|
handleConnectWallet();
|
|
379
385
|
}
|
|
380
386
|
}, [showExternalWalletButton, areSocialLoginsVisible, showPasswordLessInput, handleConnectWallet]);
|
|
@@ -418,25 +424,25 @@ function Login(props) {
|
|
|
418
424
|
};
|
|
419
425
|
const externalWalletSection = () => {
|
|
420
426
|
return jsxRuntime.jsxs("div", {
|
|
421
|
-
className: utils.cn("
|
|
427
|
+
className: utils.cn("wta:flex wta:w-full wta:flex-col wta:items-start wta:justify-start wta:gap-y-2"),
|
|
422
428
|
children: [installedExternalWallets.length > 0 && installedExternalWallets.map(wallet => jsxRuntime.jsxs("button", {
|
|
423
429
|
type: "button",
|
|
424
|
-
className: utils.cn("w3a--btn
|
|
425
|
-
"
|
|
426
|
-
"
|
|
427
|
-
"
|
|
430
|
+
className: utils.cn("w3a--btn wta:justify-between! wta:group wta:relative wta:overflow-hidden", {
|
|
431
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
432
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
433
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
428
434
|
}),
|
|
429
435
|
onClick: () => handleInstalledWalletClick(wallet),
|
|
430
436
|
children: [jsxRuntime.jsx("p", {
|
|
431
|
-
className: "
|
|
437
|
+
className: "wta:max-w-[180px] wta:truncate wta:text-base wta:font-normal wta:text-app-gray-700 wta:dark:text-app-white",
|
|
432
438
|
children: wallet.displayName
|
|
433
439
|
}), jsxRuntime.jsxs("div", {
|
|
434
|
-
className: "
|
|
440
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:flex wta:w-auto wta:-translate-y-1/2 wta:items-center wta:gap-x-2 wta:transition-all wta:duration-300 wta:group-hover:translate-x-6 wta:group-hover:opacity-0",
|
|
435
441
|
children: [wallet.hasInjectedWallet && jsxRuntime.jsx("span", {
|
|
436
|
-
className: "
|
|
442
|
+
className: "wta:inline-flex wta:items-center wta:rounded-md wta:bg-app-primary-100 wta:px-2 wta:py-1 wta:text-xs wta:font-medium wta:text-app-primary-800 \n wta:dark:border wta:dark:border-app-primary-400 wta:dark:bg-transparent wta:dark:text-app-primary-400",
|
|
437
443
|
children: t("modal.external.installed")
|
|
438
444
|
}), jsxRuntime.jsx("figure", {
|
|
439
|
-
className: "
|
|
445
|
+
className: "wta:size-5",
|
|
440
446
|
children: jsxRuntime.jsx(Image, {
|
|
441
447
|
imageData: wallet.icon,
|
|
442
448
|
imageId: `login-${wallet.name}`,
|
|
@@ -450,28 +456,28 @@ function Login(props) {
|
|
|
450
456
|
})]
|
|
451
457
|
}), jsxRuntime.jsx("img", {
|
|
452
458
|
id: "injected-wallet-arrow",
|
|
453
|
-
className: "
|
|
459
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:-translate-x-10 wta:-translate-y-1/2 wta:opacity-0 wta:transition-all wta:duration-300\n wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
|
|
454
460
|
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
455
461
|
alt: "arrow"
|
|
456
462
|
})]
|
|
457
463
|
}, wallet.name)), remainingUndisplayedWallets > 0 && jsxRuntime.jsxs("button", {
|
|
458
464
|
type: "button",
|
|
459
|
-
className: utils.cn("w3a--btn
|
|
460
|
-
"
|
|
461
|
-
"
|
|
462
|
-
"
|
|
465
|
+
className: utils.cn("w3a--btn wta:justify-between! wta:group wta:relative wta:overflow-hidden", {
|
|
466
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
467
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
468
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
463
469
|
}),
|
|
464
470
|
onClick: handleConnectWallet,
|
|
465
471
|
children: [jsxRuntime.jsx("p", {
|
|
466
|
-
className: "
|
|
472
|
+
className: "wta:text-base wta:font-normal wta:text-app-gray-900 wta:dark:text-app-white",
|
|
467
473
|
children: t("modal.external.all-wallets")
|
|
468
474
|
}), showExternalWalletCount && jsxRuntime.jsx("div", {
|
|
469
475
|
id: "external-wallet-count",
|
|
470
|
-
className: "
|
|
476
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:w-auto wta:-translate-y-1/2 wta:rounded-full wta:bg-app-primary-100 wta:px-2.5 wta:py-0.5 wta:text-xs wta:font-medium wta:text-app-primary-800 wta:transition-all wta:delay-300 wta:duration-300 wta:group-hover:translate-x-6 wta:group-hover:opacity-0 wta:group-hover:delay-0 wta:dark:border wta:dark:border-app-primary-500 wta:dark:bg-transparent wta:dark:text-app-primary-500",
|
|
471
477
|
children: remainingUndisplayedWallets
|
|
472
478
|
}), jsxRuntime.jsx("img", {
|
|
473
479
|
id: "external-wallet-arrow",
|
|
474
|
-
className: "
|
|
480
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:-translate-x-10 wta:-translate-y-1/2 wta:opacity-0 wta:transition-all wta:duration-300\n wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
|
|
475
481
|
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
476
482
|
alt: "arrow"
|
|
477
483
|
})]
|
|
@@ -481,14 +487,14 @@ function Login(props) {
|
|
|
481
487
|
const headerLogo = [constants.DEFAULT_LOGO_DARK, constants.DEFAULT_LOGO_LIGHT].includes(appLogo) ? "" : appLogo;
|
|
482
488
|
const delimiter = index => {
|
|
483
489
|
return jsxRuntime.jsxs("div", {
|
|
484
|
-
className: utils.cn("
|
|
490
|
+
className: utils.cn("wta:flex wta:w-full wta:items-center wta:gap-x-2", headerLogo ? "wta:my-2" : "wta:my-4"),
|
|
485
491
|
children: [jsxRuntime.jsx("div", {
|
|
486
|
-
className: "
|
|
492
|
+
className: "wta:h-px wta:w-full wta:bg-app-gray-200 wta:dark:bg-app-gray-500"
|
|
487
493
|
}), jsxRuntime.jsx("p", {
|
|
488
|
-
className: "
|
|
494
|
+
className: "wta:text-xs wta:font-normal wta:uppercase wta:text-app-gray-400 wta:dark:text-app-gray-400",
|
|
489
495
|
children: "or"
|
|
490
496
|
}), jsxRuntime.jsx("div", {
|
|
491
|
-
className: "
|
|
497
|
+
className: "wta:h-px wta:w-full wta:bg-app-gray-200 wta:dark:bg-app-gray-500"
|
|
492
498
|
})]
|
|
493
499
|
}, `section-delimiter-${index}`);
|
|
494
500
|
};
|
|
@@ -536,18 +542,18 @@ function Login(props) {
|
|
|
536
542
|
};
|
|
537
543
|
const socialLoginExpandedView = () => socialLoginSection(otherRow);
|
|
538
544
|
return jsxRuntime.jsxs("div", {
|
|
539
|
-
className: "
|
|
545
|
+
className: "wta:flex wta:flex-col wta:items-center wta:gap-y-4 wta:p-2",
|
|
540
546
|
children: [jsxRuntime.jsxs("div", {
|
|
541
|
-
className: utils.cn("
|
|
547
|
+
className: utils.cn("wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-2 wta:pt-6", logoAlignment === "center" ? "" : "wta:w-full"),
|
|
542
548
|
children: [headerLogo && jsxRuntime.jsx("figure", {
|
|
543
|
-
className: utils.cn("
|
|
549
|
+
className: utils.cn("wta:mx-auto wta:h-12 wta:w-[200px]", logoAlignment === "center" ? "wta:flex wta:justify-center wta:items-center" : "wta:ml-0 wta:w-auto"),
|
|
544
550
|
children: jsxRuntime.jsx("img", {
|
|
545
551
|
src: headerLogo,
|
|
546
552
|
alt: "Logo",
|
|
547
|
-
className: "
|
|
553
|
+
className: "wta:size-full wta:object-contain"
|
|
548
554
|
})
|
|
549
555
|
}), jsxRuntime.jsx("p", {
|
|
550
|
-
className: utils.cn("
|
|
556
|
+
className: utils.cn("wta:text-app-gray-900 wta:dark:text-app-white", logoAlignment === "center" ? "wta:text-center" : "wta:text-left wta:w-full wta:ml-4", headerLogo ? "wta:text-lg wta:font-semibold" : "wta:text-3xl wta:font-medium"),
|
|
551
557
|
children: t("modal.social.sign-in")
|
|
552
558
|
})]
|
|
553
559
|
}), jsxRuntime.jsx(HCaptcha, {
|
|
@@ -561,10 +567,10 @@ function Login(props) {
|
|
|
561
567
|
onError: () => setCaptchaError("passwordless.captcha-default-error"),
|
|
562
568
|
onChalExpired: () => setCaptchaError("passwordless.captcha-default-error")
|
|
563
569
|
}), captchaError && showCaptcha && jsxRuntime.jsx("p", {
|
|
564
|
-
className: "
|
|
570
|
+
className: "wta:-mt-2 wta:w-full wta:pl-6 wta:text-start wta:text-xs wta:font-normal wta:text-app-red-500 wta:dark:text-app-red-400",
|
|
565
571
|
children: t(captchaError)
|
|
566
572
|
}), !showCaptcha && jsxRuntime.jsxs("div", {
|
|
567
|
-
className: "
|
|
573
|
+
className: "wta:flex wta:w-full wta:flex-col wta:items-center wta:justify-center wta:gap-y-2",
|
|
568
574
|
children: [!expandSocialLogins && defaultView(), expandSocialLogins && socialLoginExpandedView()]
|
|
569
575
|
})]
|
|
570
576
|
});
|
|
@@ -35,16 +35,16 @@ function OtpInput(props) {
|
|
|
35
35
|
}, [loginHint, authConnection, countryFlag]);
|
|
36
36
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37
37
|
children: [jsxRuntime.jsx("div", {
|
|
38
|
-
className: "
|
|
38
|
+
className: "wta:mr-auto wta:flex wta:w-full wta:items-start wta:justify-start",
|
|
39
39
|
children: jsxRuntime.jsx("button", {
|
|
40
40
|
type: "button",
|
|
41
|
-
className: "
|
|
41
|
+
className: "wta:z-20 wta:flex wta:size-5 wta:cursor-pointer wta:items-center wta:justify-center wta:rounded-full",
|
|
42
42
|
onClick: () => setShowOtpFlow(false),
|
|
43
43
|
children: jsxRuntime.jsx("svg", {
|
|
44
44
|
xmlns: "http://www.w3.org/2000/svg",
|
|
45
45
|
fill: "none",
|
|
46
46
|
viewBox: "0 0 20 20",
|
|
47
|
-
className: "
|
|
47
|
+
className: "wta:text-app-gray-900 wta:dark:text-app-white",
|
|
48
48
|
children: jsxRuntime.jsx("path", {
|
|
49
49
|
fill: "currentColor",
|
|
50
50
|
fillRule: "evenodd",
|
|
@@ -54,23 +54,23 @@ function OtpInput(props) {
|
|
|
54
54
|
})
|
|
55
55
|
})
|
|
56
56
|
}), jsxRuntime.jsxs("div", {
|
|
57
|
-
className: "
|
|
57
|
+
className: "wta:-mt-10 wta:flex wta:size-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4",
|
|
58
58
|
children: [jsxRuntime.jsx("img", {
|
|
59
59
|
src: utils.getIcons(isMobileOtp ? "sms-otp-light" : "email-otp-light"),
|
|
60
60
|
alt: "otp",
|
|
61
|
-
className: "
|
|
61
|
+
className: "wta:size-auto"
|
|
62
62
|
}), jsxRuntime.jsxs("div", {
|
|
63
|
-
className: "
|
|
63
|
+
className: "wta:mx-auto wta:-mt-6 wta:flex wta:w-full wta:flex-col wta:items-center wta:justify-center wta:gap-y-2",
|
|
64
64
|
children: [jsxRuntime.jsx("p", {
|
|
65
|
-
className: "
|
|
65
|
+
className: "wta:text-lg wta:font-bold wta:text-app-gray-900 wta:dark:text-app-white",
|
|
66
66
|
children: isMobileOtp ? t("modal.otp.mobile-title") : t("modal.otp.email-title")
|
|
67
67
|
}), jsxRuntime.jsxs("div", {
|
|
68
|
-
className: "
|
|
68
|
+
className: "wta:mx-auto wta:flex wta:w-full wta:flex-col wta:items-center wta:justify-center wta:gap-y-1",
|
|
69
69
|
children: [jsxRuntime.jsx("p", {
|
|
70
|
-
className: "
|
|
70
|
+
className: "wta:text-center wta:text-sm wta:font-normal wta:text-app-gray-500 wta:dark:text-app-gray-300",
|
|
71
71
|
children: isMobileOtp ? t("modal.otp.mobile-subtext") : t("modal.otp.email-subtext")
|
|
72
72
|
}), jsxRuntime.jsx("p", {
|
|
73
|
-
className: "
|
|
73
|
+
className: "wta:text-center wta:text-sm wta:font-normal wta:text-app-gray-500 wta:dark:text-app-gray-300",
|
|
74
74
|
children: isMobileOtp ? parsedLoginHint : t("modal.otp.email-subtext-example", {
|
|
75
75
|
email: parsedLoginHint
|
|
76
76
|
})
|
|
@@ -103,7 +103,7 @@ function LoginOtp(props) {
|
|
|
103
103
|
countryFlag
|
|
104
104
|
} = props;
|
|
105
105
|
return jsxRuntime.jsx("div", {
|
|
106
|
-
className: "
|
|
106
|
+
className: "wta:flex wta:size-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4",
|
|
107
107
|
children: jsxRuntime.jsx(OtpInput, {
|
|
108
108
|
errorMessage: errorMessage,
|
|
109
109
|
setShowOtpFlow: setShowOtpFlow,
|
package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js
CHANGED
|
@@ -59,22 +59,22 @@ function LoginPasswordLess(props) {
|
|
|
59
59
|
if (!isPasswordLessCtaClicked) {
|
|
60
60
|
return jsxRuntime.jsxs("button", {
|
|
61
61
|
type: "button",
|
|
62
|
-
className: utils.cn("w3a--btn
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
62
|
+
className: utils.cn("w3a--btn wta:justify-between! wta:relative wta:group wta:overflow-hidden", {
|
|
63
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
64
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
65
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
66
66
|
}),
|
|
67
67
|
onClick: () => {
|
|
68
68
|
setIsPasswordLessCtaClicked(true);
|
|
69
69
|
},
|
|
70
70
|
children: [jsxRuntime.jsx("p", {
|
|
71
|
-
className: "
|
|
71
|
+
className: "wta:text-app-gray-900 wta:dark:text-app-white",
|
|
72
72
|
children: t("modal.passwordless.title", {
|
|
73
73
|
title
|
|
74
74
|
})
|
|
75
75
|
}), jsxRuntime.jsx("img", {
|
|
76
76
|
id: "passwordless-arrow",
|
|
77
|
-
className: "
|
|
77
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:-translate-x-6 wta:-translate-y-1/2 wta:opacity-0 wta:transition-all wta:duration-300\n wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
|
|
78
78
|
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
79
79
|
alt: "arrow"
|
|
80
80
|
})]
|
|
@@ -82,10 +82,10 @@ function LoginPasswordLess(props) {
|
|
|
82
82
|
}
|
|
83
83
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
84
84
|
children: [jsxRuntime.jsxs("div", {
|
|
85
|
-
className: utils.cn("w3a--input", isInputFocused && "
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
85
|
+
className: utils.cn("w3a--input", isInputFocused && "wta:border-app-primary-600!", {
|
|
86
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
87
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
88
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
89
89
|
}),
|
|
90
90
|
children: [jsxRuntime.jsx("input", {
|
|
91
91
|
ref: inputRef,
|
|
@@ -100,12 +100,12 @@ function LoginPasswordLess(props) {
|
|
|
100
100
|
setIsInputFocused(false);
|
|
101
101
|
},
|
|
102
102
|
type: "text",
|
|
103
|
-
className: utils.cn("
|
|
103
|
+
className: utils.cn("wta:w-full wta:appearance-none wta:bg-transparent wta:text-app-gray-900 wta:outline-none wta:placeholder:text-xs wta:placeholder:text-app-gray-400 wta:focus:outline-none wta:active:outline-none wta:dark:text-app-white wta:dark:placeholder:text-app-gray-500"),
|
|
104
104
|
onKeyDown: e => handleEnter(e),
|
|
105
105
|
disabled: isPasswordLessLoading
|
|
106
106
|
}), isPasswordLessLoading && jsxRuntime.jsx(PulseLoader, {}), inputValue && !isPasswordLessLoading && jsxRuntime.jsx("button", {
|
|
107
107
|
type: "button",
|
|
108
|
-
className: "
|
|
108
|
+
className: "wta:appearance-none",
|
|
109
109
|
onClick: onFormSubmit,
|
|
110
110
|
children: jsxRuntime.jsx("img", {
|
|
111
111
|
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
@@ -113,7 +113,7 @@ function LoginPasswordLess(props) {
|
|
|
113
113
|
})
|
|
114
114
|
})]
|
|
115
115
|
}), errorMessage && !isInputFocused && isPasswordLessCtaClicked && jsxRuntime.jsx("p", {
|
|
116
|
-
className: "
|
|
116
|
+
className: "wta:w-full wta:pl-6 wta:text-start wta:text-xs wta:font-normal wta:text-app-red-500 wta:dark:text-app-red-400",
|
|
117
117
|
children: errorMessage
|
|
118
118
|
})]
|
|
119
119
|
});
|
|
@@ -4,7 +4,7 @@ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var noModal = require('@web3auth/no-modal');
|
|
6
6
|
var react = require('react');
|
|
7
|
-
var
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
8
8
|
var Footer = require('../../components/Footer/Footer.js');
|
|
9
9
|
var Loader = require('../../components/Loader/Loader.js');
|
|
10
10
|
var Toast = require('../../components/Toast/Toast.js');
|
|
@@ -13,6 +13,8 @@ var ModalStateContext = require('../../context/ModalStateContext.js');
|
|
|
13
13
|
var RootContext = require('../../context/RootContext.js');
|
|
14
14
|
var WidgetContext = require('../../context/WidgetContext.js');
|
|
15
15
|
var interfaces = require('../../interfaces.js');
|
|
16
|
+
var localeImport = require('../../localeImport.js');
|
|
17
|
+
var AccountLinking = require('../AccountLinking/AccountLinking.js');
|
|
16
18
|
var ConnectWallet = require('../ConnectWallet/ConnectWallet.js');
|
|
17
19
|
var Login = require('../Login/Login.js');
|
|
18
20
|
var RootBodySheets = require('./RootBodySheets/RootBodySheets.js');
|
|
@@ -21,6 +23,9 @@ function RootContent(props) {
|
|
|
21
23
|
const {
|
|
22
24
|
onCloseLoader
|
|
23
25
|
} = props;
|
|
26
|
+
const [t] = reactI18next.useTranslation(undefined, {
|
|
27
|
+
i18n: localeImport
|
|
28
|
+
});
|
|
24
29
|
const {
|
|
25
30
|
modalState,
|
|
26
31
|
shouldShowLoginPage,
|
|
@@ -178,14 +183,21 @@ function RootContent(props) {
|
|
|
178
183
|
const isExternalWalletModeOnly = react.useMemo(() => {
|
|
179
184
|
return !showPasswordLessInput && !areSocialLoginsVisible;
|
|
180
185
|
}, [areSocialLoginsVisible, showPasswordLessInput]);
|
|
186
|
+
const isWalletConnectAccountLinkingVisible = react.useMemo(() => {
|
|
187
|
+
return modalState.accountLinking.active && modalState.accountLinking.transportConnectorName === noModal.WALLET_CONNECTORS.WALLET_CONNECT_V2;
|
|
188
|
+
}, [modalState.accountLinking.active, modalState.accountLinking.transportConnectorName]);
|
|
181
189
|
const isShowLoader = react.useMemo(() => {
|
|
182
|
-
return modalState.status !== interfaces.MODAL_STATUS.INITIALIZED;
|
|
183
|
-
}, [modalState.status]);
|
|
184
|
-
const
|
|
190
|
+
return !isWalletConnectAccountLinkingVisible && modalState.status !== interfaces.MODAL_STATUS.INITIALIZED;
|
|
191
|
+
}, [isWalletConnectAccountLinkingVisible, modalState.status]);
|
|
192
|
+
const loaderMessage = react.useMemo(() => {
|
|
193
|
+
const message = modalState.postLoadingMessage;
|
|
194
|
+
if (!message) return undefined;
|
|
195
|
+
return localeImport.exists(message) ? t(message) : message;
|
|
196
|
+
}, [modalState.postLoadingMessage, t]);
|
|
185
197
|
return jsxRuntime.jsxs("div", {
|
|
186
|
-
className: "
|
|
198
|
+
className: "wta:relative wta:flex wta:flex-col",
|
|
187
199
|
children: [jsxRuntime.jsxs("div", {
|
|
188
|
-
className: "w3a-modal-container
|
|
200
|
+
className: "w3a-modal-container wta:relative wta:flex wta:flex-col wta:overflow-hidden",
|
|
189
201
|
style: {
|
|
190
202
|
height: containerHeight
|
|
191
203
|
},
|
|
@@ -193,11 +205,12 @@ function RootContent(props) {
|
|
|
193
205
|
className: "w3a--modal-curtain"
|
|
194
206
|
}), jsxRuntime.jsxs("div", {
|
|
195
207
|
ref: contentRef,
|
|
196
|
-
className:
|
|
208
|
+
className: "wta:relative wta:flex wta:flex-none wta:flex-col wta:p-6",
|
|
197
209
|
children: [isShowLoader ? jsxRuntime.jsx(Loader, {
|
|
198
210
|
connector: modalState.detailedLoaderConnector,
|
|
199
211
|
connectorName: modalState.detailedLoaderConnectorName,
|
|
200
212
|
modalStatus: modalState.status,
|
|
213
|
+
message: loaderMessage,
|
|
201
214
|
onClose: onCloseLoader,
|
|
202
215
|
isConnectAndSignAuthenticationMode: isConnectAndSignAuthenticationMode,
|
|
203
216
|
externalWalletsConfig: modalState.externalWalletsConfig,
|
|
@@ -208,11 +221,13 @@ function RootContent(props) {
|
|
|
208
221
|
privacyPolicy: privacyPolicy,
|
|
209
222
|
tncLink: tncLink
|
|
210
223
|
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
211
|
-
children: [
|
|
224
|
+
children: [isWalletConnectAccountLinkingVisible && jsxRuntime.jsx(AccountLinking, {
|
|
225
|
+
allExternalWallets: allExternalWallets
|
|
226
|
+
}), !isWalletConnectAccountLinkingVisible && !modalState.accountLinking.pickerActive && modalState.currentPage === constants.PAGES.LOGIN_OPTIONS && shouldShowLoginPage && modalState.status === interfaces.MODAL_STATUS.INITIALIZED && jsxRuntime.jsx(Login, {
|
|
212
227
|
installedExternalWalletConfig: topInstalledConnectorButtons,
|
|
213
228
|
totalExternalWallets: allExternalWallets.length,
|
|
214
229
|
remainingUndisplayedWallets: remainingUndisplayedWallets
|
|
215
|
-
}), modalState.currentPage === constants.PAGES.WALLET_LIST && (!shouldShowLoginPage || isExternalWalletModeOnly) && modalState.status === interfaces.MODAL_STATUS.INITIALIZED && jsxRuntime.jsx(ConnectWallet, {
|
|
230
|
+
}), !isWalletConnectAccountLinkingVisible && modalState.currentPage === constants.PAGES.WALLET_LIST && (!shouldShowLoginPage || isExternalWalletModeOnly || modalState.accountLinking.pickerActive) && modalState.status === interfaces.MODAL_STATUS.INITIALIZED && jsxRuntime.jsx(ConnectWallet, {
|
|
216
231
|
allRegistryButtons: allRegistryButtons,
|
|
217
232
|
connectorVisibilityMap: connectorVisibilityMap,
|
|
218
233
|
customConnectorButtons: customConnectorButtons,
|