@web3auth/modal 10.0.0-beta.2 → 10.0.0-beta.3
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/lib.cjs/packages/modal/src/config.js +1 -3
- package/dist/lib.cjs/packages/modal/src/modalManager.js +44 -21
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +8 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +12 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +13 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +5 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/Login.js +45 -19
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +10 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +18 -32
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +15 -34
- package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +2 -1
- package/dist/lib.cjs/packages/modal/src/ui/config.js +2 -1
- package/dist/lib.cjs/packages/modal/src/ui/constants.js +4 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/handlers/AbstractHandler.js +3 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +5 -3
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +15 -3
- package/dist/lib.cjs/types/interface.d.ts +3 -1
- package/dist/lib.cjs/types/modalManager.d.ts +4 -1
- package/dist/lib.cjs/types/ui/components/Login/Login.type.d.ts +2 -2
- package/dist/lib.cjs/types/ui/config.d.ts +1 -1
- package/dist/lib.cjs/types/ui/constants.d.ts +2 -0
- package/dist/lib.cjs/types/ui/handlers/AbstractHandler.d.ts +1 -1
- package/dist/lib.cjs/types/ui/interfaces.d.ts +5 -3
- package/dist/lib.esm/packages/modal/src/config.js +1 -3
- package/dist/lib.esm/packages/modal/src/modalManager.js +46 -22
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +8 -1
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +14 -6
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +2 -2
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +13 -5
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +5 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Login/Login.js +48 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +11 -6
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +18 -33
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +16 -35
- package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +3 -2
- package/dist/lib.esm/packages/modal/src/ui/config.js +2 -1
- package/dist/lib.esm/packages/modal/src/ui/constants.js +3 -1
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/handlers/AbstractHandler.js +3 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +6 -4
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +16 -3
- package/dist/modal.umd.min.js +1 -1
- package/package.json +11 -11
|
@@ -6,6 +6,9 @@ var modal = {
|
|
|
6
6
|
"adapter-loader.message": "Devam etmek için {{adapter}} hesabınızı doğrula",
|
|
7
7
|
"adapter-loader.message1": "{{adapter}} doğrula",
|
|
8
8
|
"adapter-loader.message2": "devam edecek hesap",
|
|
9
|
+
allChains: "Tüm zincirler",
|
|
10
|
+
"connect-wallet.more-wallets": "Daha fazla cüzdan",
|
|
11
|
+
connectYourWallet: "Cüzdanınızı bağlayın",
|
|
9
12
|
"errors-invalid-email": "Geçersiz E-posta",
|
|
10
13
|
"errors-invalid-number": "Geçersiz Telefon Numarası",
|
|
11
14
|
"errors-invalid-number-email": "Geçersiz E-posta veya Telefon Numarası",
|
|
@@ -13,8 +16,6 @@ var modal = {
|
|
|
13
16
|
"external.all-wallets": "Tüm cüzdanlar",
|
|
14
17
|
"external.back": "Geri",
|
|
15
18
|
"external.connect": "Cüzdanla devam et",
|
|
16
|
-
"external.search-text": "Cüzdanınızı görmüyor musunuz?",
|
|
17
|
-
"external.search-subtext": "Bunun yerine aramayı deneyin",
|
|
18
19
|
"external.connect-wallet": "Cüzdanı Bağla",
|
|
19
20
|
"external.continue": "Harici cüzdanla devam et",
|
|
20
21
|
"external.continue-custom": "{{wallet}} ile devam et",
|
|
@@ -25,19 +26,26 @@ var modal = {
|
|
|
25
26
|
"external.install-mobile-app": "{{os}} uygulamasını yükle",
|
|
26
27
|
"external.installed": "Yüklendi",
|
|
27
28
|
"external.no-wallets-found": "Cüzdan bulunamadı",
|
|
29
|
+
"external.search-subtext": "Bunun yerine aramayı deneyin",
|
|
30
|
+
"external.search-text": "Cüzdanınızı görmüyor musunuz?",
|
|
28
31
|
"external.search-wallet": "{{count}} cüzdan ara...",
|
|
29
32
|
"external.select-chain": "Zincir seç",
|
|
30
33
|
"external.select-chain-description": "Bu {{wallet}} cüzdan birden fazla zincir destekler. İstediğiniz zinciri seçin",
|
|
31
34
|
"external.title": "Harici Cüzdan",
|
|
32
35
|
"external.walletconnect-connect": "Bağla",
|
|
33
|
-
"external.walletconnect-copy": "WalletConnect destekli bir cüzdanla tarayın veya
|
|
36
|
+
"external.walletconnect-copy": "WalletConnect destekli bir cüzdanla QR kodu tarayın veya bağlantıyı kopyalayın",
|
|
34
37
|
"external.walletconnect-subtitle": "QR kodunu WalletConnect uyumlu bir cüzdanla tarayın",
|
|
38
|
+
"footer.and": "ve",
|
|
39
|
+
"footer.by-signing-in": "Giriş yapmak, bizimle ilgili şartları kabul ettiğiniz anlamına gelir.",
|
|
35
40
|
"footer.message": "Öz-yönetimli giriş yapan:",
|
|
36
41
|
"footer.message-new": "Kendi kendine velayet",
|
|
37
42
|
"footer.policy": "Gizlilik Politikası",
|
|
43
|
+
"footer.privacy-policy": "Gizlilik Politikası",
|
|
38
44
|
"footer.terms": "Kullanım Şartları",
|
|
45
|
+
"footer.terms-of-service": "Kullanım Şartları",
|
|
39
46
|
"footer.terms-service": "Hizmet Şartları",
|
|
40
47
|
"footer.version": "Versiyon",
|
|
48
|
+
getWallet: "Cüzdanı al",
|
|
41
49
|
"header-subtitle": "Devam etmek için seçeneklerden birini işaretle",
|
|
42
50
|
"header-subtitle-name": "Tek tıklama ile {{appName}} cüzdanınız",
|
|
43
51
|
"header-subtitle-new": "Tek tıklama ile blockchain cüzdanınız",
|
|
@@ -50,6 +58,12 @@ var modal = {
|
|
|
50
58
|
"network.proceed": "Devam",
|
|
51
59
|
"network.switch-request": "Bu site ağ değiştirmeyi talep ediyor",
|
|
52
60
|
"network.to": "Nereye",
|
|
61
|
+
"otp.email-subtext": "6 haneli doğrulama kodunu giriniz",
|
|
62
|
+
"otp.email-subtext-example": "{{email}} adresine gönderildi",
|
|
63
|
+
"otp.email-title": "Email Doğrulama",
|
|
64
|
+
"otp.mobile-subtext": "OTP Doğrulama",
|
|
65
|
+
"otp.mobile-title": "OTP Doğrulama",
|
|
66
|
+
"otp.success": "Hesabınıza bağlandınız!",
|
|
53
67
|
"passkey.add": "Passkey ekle",
|
|
54
68
|
"passkey.haveExisting": "Mevcut bir passkey'ınız mı var?",
|
|
55
69
|
"passkey.learn-more": "Daha fazla bilgi edin",
|
|
@@ -57,10 +71,13 @@ var modal = {
|
|
|
57
71
|
"passkey.register-desc": "passkeys ile kimliğinizi yüzünüz, parmak iziniz veya güvenlik anahtarlarınız aracılığıyla doğrulayabilirsiniz.",
|
|
58
72
|
"passkey.register-title": "Passkey'ı kaydedin",
|
|
59
73
|
"passkey.use": "Bir passkey'im var",
|
|
74
|
+
"passwordless.title": "{{title}} ile devam et",
|
|
60
75
|
"popup.phone-body": "Ülke kodunuz otomatik olarak algılanacaktır, ancak farklı bir ülkeden bir telefon numarası kullanıyorsanız, doğru ülke kodunu manuel olarak girmeniz gerekir.",
|
|
61
76
|
"popup.phone-header": "Telefon numarası ve ülke kodu",
|
|
62
77
|
"post-loading.connected": "Hesabınızla bağlandınız",
|
|
63
78
|
"post-loading.something-wrong": "Bir şeyler ters gitti!",
|
|
79
|
+
resendCode: "Kodu tekrar gönder",
|
|
80
|
+
resendTimer: " {{timer}} saniye sonra tekrar gönder",
|
|
64
81
|
"social.continue": "Devam et: ",
|
|
65
82
|
"social.continueCustom": "{{adapter}} ile devam et",
|
|
66
83
|
"social.email": "E-posta",
|
|
@@ -68,9 +85,10 @@ var modal = {
|
|
|
68
85
|
"social.email-new": "isim@ornek.com",
|
|
69
86
|
"social.passwordless-cta": "Devam et",
|
|
70
87
|
"social.passwordless-login": "Giriş yapmak",
|
|
71
|
-
"social.passwordless-title": "E-posta
|
|
88
|
+
"social.passwordless-title": "E-posta/Telefon",
|
|
72
89
|
"social.phone": "Telefon",
|
|
73
90
|
"social.policy": "Sosyal medya girişlerinizle ilgili hiçbir veriyi saklamıyoruz.",
|
|
91
|
+
"social.sign-in": "Giriş yap",
|
|
74
92
|
"social.sms": "Mobil Telefon",
|
|
75
93
|
"social.sms-continue": "Telefon ile devam et",
|
|
76
94
|
"social.sms-invalid-number": "Geçersiz telefon numarası",
|
|
@@ -78,39 +96,22 @@ var modal = {
|
|
|
78
96
|
"social.view-less": "Daha az görüntüle",
|
|
79
97
|
"social.view-less-socials": "Daha az socials görüntüle",
|
|
80
98
|
"social.view-more": "Daha fazla görüntüle",
|
|
81
|
-
"social.view-more-socials": "Daha fazlasını görüntüle socials"
|
|
82
|
-
"social.sign-in": "Giriş yap",
|
|
83
|
-
"footer.by-signing-in": "Giriş yapmak, bizimle ilgili şartları kabul ettiğiniz anlamına gelir.",
|
|
84
|
-
"footer.terms-of-service": "Kullanım Şartları",
|
|
85
|
-
"footer.and": "ve",
|
|
86
|
-
"footer.privacy-policy": "Gizlilik Politikası",
|
|
87
|
-
"connect-wallet.more-wallets": "Daha fazla cüzdan",
|
|
88
|
-
"otp.success": "Hesabınıza bağlandınız!",
|
|
89
|
-
"otp.mobile-title": "OTP Doğrulama",
|
|
90
|
-
"otp.mobile-subtext": "OTP Doğrulama",
|
|
91
|
-
"otp.email-title": "Email Doğrulama",
|
|
92
|
-
"otp.email-subtext": "6 haneli doğrulama kodunu giriniz",
|
|
93
|
-
"otp.email-subtext-example": "{{email}} adresine gönderildi",
|
|
94
|
-
"passwordless.title": "{{title}} ile devam et",
|
|
95
|
-
resendCode: "Kodu tekrar gönder",
|
|
96
|
-
resendTimer: " {{timer}} saniye sonra tekrar gönder",
|
|
97
|
-
connectYourWallet: "Cüzdanınızı bağlayın",
|
|
98
|
-
allChains: "Tüm zincirler"
|
|
99
|
+
"social.view-more-socials": "Daha fazlasını görüntüle socials"
|
|
99
100
|
};
|
|
100
101
|
var passwordless = {
|
|
101
|
-
"error-invalid-params": "Eksik ya da hatalı parametreler var.",
|
|
102
|
-
"error-sending-sms-failed": "SMS gönderilirken bir hata oldu. Lütfen tekrar deneyin.",
|
|
103
|
-
"error-no-mail-generated": "E-posta oluşturulmadı. Lütfen önce şifresiz akışı başlatın.",
|
|
104
102
|
"error-invalid-link": "Hatalı ya da süresi geçmiş doğrulama linki",
|
|
105
|
-
"error-
|
|
103
|
+
"error-invalid-origin": "Bir şeyler ters gitti, hata kodu: E002",
|
|
106
104
|
"error-invalid-otp": "Hatalı OTP, lütfen tekrar deneyin.",
|
|
107
|
-
"error-
|
|
108
|
-
"error-no-sms-generated": "OTP oluşturulmadı. Lütfen önce şifresiz akışı başlatın.",
|
|
105
|
+
"error-invalid-params": "Eksik ya da hatalı parametreler var.",
|
|
109
106
|
"error-max-retry-limit-reached": "Hatalı deneme limitine ulaştınız. Doğrulamayı tamamlamak için lütfen akışı baştan başlatın.",
|
|
110
|
-
"error-
|
|
107
|
+
"error-new-link-generated-heading": "Yeni doğrulama linki oluşturuldu.",
|
|
108
|
+
"error-no-mail-generated": "E-posta oluşturulmadı. Lütfen önce şifresiz akışı başlatın.",
|
|
109
|
+
"error-no-sms-generated": "OTP oluşturulmadı. Lütfen önce şifresiz akışı başlatın.",
|
|
110
|
+
"error-otp-expired": "OTP'nin süresi geçti.",
|
|
111
111
|
"error-plan-limit-reached": "E411. Sınır aşıldı",
|
|
112
|
-
"
|
|
113
|
-
"error-
|
|
112
|
+
"error-recaptcha-verification-failed": "Captcha doğrulama hatası. Lütfen tekrar deneyin.",
|
|
113
|
+
"error-sending-sms-failed": "SMS gönderilirken bir hata oldu. Lütfen tekrar deneyin.",
|
|
114
|
+
"something-wrong-error": "Bir şeyler ters gitti"
|
|
114
115
|
};
|
|
115
116
|
var turkish = {
|
|
116
117
|
modal: modal,
|
|
@@ -116,13 +116,14 @@ class LoginModal {
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
return new Promise(resolve => {
|
|
119
|
-
var _this$uiConfig;
|
|
119
|
+
var _this$uiConfig, _this$uiConfig$theme, _this$uiConfig2;
|
|
120
120
|
this.stateEmitter.once("MOUNTED", () => {
|
|
121
121
|
noModal.log.info("rendered");
|
|
122
122
|
this.setState({
|
|
123
123
|
status: interfaces.MODAL_STATUS.INITIALIZED,
|
|
124
124
|
web3authClientId: this.uiConfig.web3authClientId,
|
|
125
|
-
web3authNetwork: this.uiConfig.web3authNetwork
|
|
125
|
+
web3authNetwork: this.uiConfig.web3authNetwork,
|
|
126
|
+
authBuildEnv: this.uiConfig.authBuildEnv
|
|
126
127
|
});
|
|
127
128
|
return resolve();
|
|
128
129
|
});
|
|
@@ -155,7 +156,8 @@ class LoginModal {
|
|
|
155
156
|
uiConfig: this.uiConfig
|
|
156
157
|
})
|
|
157
158
|
}));
|
|
158
|
-
|
|
159
|
+
const isDefaultColors = ((_this$uiConfig = this.uiConfig) === null || _this$uiConfig === void 0 || (_this$uiConfig = _this$uiConfig.theme) === null || _this$uiConfig === void 0 ? void 0 : _this$uiConfig.primary) === constants.DEFAULT_PRIMARY_COLOR && ((_this$uiConfig$theme = this.uiConfig.theme) === null || _this$uiConfig$theme === void 0 ? void 0 : _this$uiConfig$theme.onPrimary) === constants.DEFAULT_ON_PRIMARY_COLOR;
|
|
160
|
+
if ((_this$uiConfig2 = this.uiConfig) !== null && _this$uiConfig2 !== void 0 && _this$uiConfig2.theme && !isDefaultColors) {
|
|
159
161
|
const rootElement = document.getElementById("w3a-parent-container");
|
|
160
162
|
auth.applyWhiteLabelTheme(rootElement, this.uiConfig.theme);
|
|
161
163
|
}
|
|
@@ -70,7 +70,7 @@ const Web3AuthProvider = vue.defineComponent({
|
|
|
70
70
|
if (!web3Auth.value) throw noModal.WalletInitializationError.notReady();
|
|
71
71
|
return web3Auth.value.switchChain(chainParams);
|
|
72
72
|
};
|
|
73
|
-
vue.watch(() => props.config, newConfig => {
|
|
73
|
+
vue.watch(() => props.config, (newConfig, _, onInvalidate) => {
|
|
74
74
|
const resetHookState = () => {
|
|
75
75
|
provider.value = null;
|
|
76
76
|
userInfo.value = null;
|
|
@@ -78,6 +78,11 @@ const Web3AuthProvider = vue.defineComponent({
|
|
|
78
78
|
isConnected.value = false;
|
|
79
79
|
status.value = null;
|
|
80
80
|
};
|
|
81
|
+
onInvalidate(() => {
|
|
82
|
+
if (web3Auth.value) {
|
|
83
|
+
web3Auth.value.cleanup();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
81
86
|
resetHookState();
|
|
82
87
|
const {
|
|
83
88
|
web3AuthOptions
|
|
@@ -87,12 +92,19 @@ const Web3AuthProvider = vue.defineComponent({
|
|
|
87
92
|
}, {
|
|
88
93
|
immediate: true
|
|
89
94
|
});
|
|
90
|
-
vue.watch(web3Auth, async newWeb3Auth => {
|
|
95
|
+
vue.watch(web3Auth, async (newWeb3Auth, _, onInvalidate) => {
|
|
96
|
+
const controller = new AbortController();
|
|
97
|
+
// Invalidate the controller here before calling any async methods.
|
|
98
|
+
onInvalidate(() => {
|
|
99
|
+
controller.abort();
|
|
100
|
+
});
|
|
91
101
|
if (newWeb3Auth) {
|
|
92
102
|
try {
|
|
93
103
|
initError.value = null;
|
|
94
104
|
isInitializing.value = true;
|
|
95
|
-
await newWeb3Auth.initModal(
|
|
105
|
+
await newWeb3Auth.initModal({
|
|
106
|
+
signal: controller.signal
|
|
107
|
+
});
|
|
96
108
|
} catch (error) {
|
|
97
109
|
initError.value = error;
|
|
98
110
|
} finally {
|
|
@@ -7,6 +7,8 @@ export interface ConnectorsModalConfig {
|
|
|
7
7
|
hideWalletDiscovery?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface IWeb3AuthModal extends IWeb3Auth {
|
|
10
|
-
initModal(
|
|
10
|
+
initModal(options?: {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}): Promise<void>;
|
|
11
13
|
connect(): Promise<IProvider | null>;
|
|
12
14
|
}
|
|
@@ -16,10 +16,13 @@ export declare class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal
|
|
|
16
16
|
readonly options: Web3AuthOptions;
|
|
17
17
|
private modalConfig;
|
|
18
18
|
constructor(options: Web3AuthOptions);
|
|
19
|
-
initModal(
|
|
19
|
+
initModal(options?: {
|
|
20
|
+
signal?: AbortSignal;
|
|
21
|
+
}): Promise<void>;
|
|
20
22
|
connect(): Promise<IProvider | null>;
|
|
21
23
|
private filterWalletRegistry;
|
|
22
24
|
private getProjectAndWalletConfig;
|
|
25
|
+
private initUIConfig;
|
|
23
26
|
private initConnectors;
|
|
24
27
|
private filterConnectors;
|
|
25
28
|
private checkConnectorAvailability;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { WEB3AUTH_NETWORK_TYPE } from "@web3auth/
|
|
1
|
+
import { BUILD_ENV_TYPE, WEB3AUTH_NETWORK_TYPE } from "@web3auth/auth";
|
|
2
2
|
import type { ButtonRadiusType, ExternalButton, ExternalWalletEventType, LogoAlignmentType, SocialLoginEventType, SocialLoginsConfig } from "../../interfaces";
|
|
3
3
|
export interface LoginProps {
|
|
4
4
|
web3authClientId: string;
|
|
5
5
|
web3authNetwork: WEB3AUTH_NETWORK_TYPE;
|
|
6
|
+
authBuildEnv: BUILD_ENV_TYPE;
|
|
6
7
|
isModalVisible: boolean;
|
|
7
8
|
isDark: boolean;
|
|
8
9
|
appLogo?: string;
|
|
@@ -21,7 +22,6 @@ export interface LoginProps {
|
|
|
21
22
|
totalExternalWallets: number;
|
|
22
23
|
logoAlignment?: LogoAlignmentType;
|
|
23
24
|
buttonRadius?: ButtonRadiusType;
|
|
24
|
-
enableMainSocialLoginButton?: boolean;
|
|
25
25
|
handleExternalWalletBtnClick?: (flag: boolean) => void;
|
|
26
26
|
handleSocialLoginClick: (params: SocialLoginEventType) => void;
|
|
27
27
|
handleExternalWalletClick: (params: ExternalWalletEventType) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AUTH_CONNECTION_TYPE, BUILD_ENV_TYPE } from "@web3auth/auth";
|
|
2
2
|
export declare function capitalizeFirstLetter(string: string): string;
|
|
3
3
|
export declare const restrictedLoginMethods: Set<AUTH_CONNECTION_TYPE>;
|
|
4
|
-
export declare const AUTH_PROVIDERS: ("google" | "
|
|
4
|
+
export declare const AUTH_PROVIDERS: ("google" | "twitter" | "facebook" | "discord" | "farcaster" | "apple" | "github" | "reddit" | "line" | "kakao" | "linkedin" | "twitch" | "telegram" | "wechat" | "email_passwordless" | "sms_passwordless" | "custom" | "passkeys" | "authenticator")[];
|
|
5
5
|
export declare const AUTH_PROVIDERS_NAMES: Record<AUTH_CONNECTION_TYPE, string>;
|
|
6
6
|
export declare const PASSWORDLESS_BUILD_ENV_MAP: Record<BUILD_ENV_TYPE, string>;
|
|
7
7
|
export declare const CAPTCHA_SITE_KEY = "d5f0c15c-eeda-4f9c-934a-d8e0348e83b2";
|
|
@@ -11,3 +11,5 @@ export declare const CONNECT_WALLET_PAGES: {
|
|
|
11
11
|
export declare const DEFAULT_LOGO_LIGHT = "https://images.web3auth.io/web3auth-logo-w.svg";
|
|
12
12
|
export declare const DEFAULT_LOGO_DARK = "https://images.web3auth.io/web3auth-logo-w-light.svg";
|
|
13
13
|
export declare const WALLET_CONNECT_LOGO = "https://images.web3auth.io/login-wallet-connect.svg";
|
|
14
|
+
export declare const DEFAULT_PRIMARY_COLOR = "#0364FF";
|
|
15
|
+
export declare const DEFAULT_ON_PRIMARY_COLOR = "#FFFFFF";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CodeInitiateRequestBodyParams, CodeVerifyRequestBodyParams, IStartResponse, IVerifyResponse, PasswordlessHandlerParams, WhiteLabelParams } from "../interfaces";
|
|
2
2
|
export declare abstract class PasswordlessHandler {
|
|
3
|
-
|
|
3
|
+
authBaseApiUrl: string;
|
|
4
4
|
passwordlessParams: PasswordlessHandlerParams;
|
|
5
5
|
trackingIdentifier?: string;
|
|
6
6
|
constructor(params: PasswordlessHandlerParams);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AUTH_CONNECTION_TYPE, EMAIL_FLOW_TYPE, ExtraLoginOptions, LANGUAGES, SafeEventEmitter, THEME_MODE_TYPE, WEB3AUTH_NETWORK_TYPE } from "@web3auth/auth";
|
|
1
|
+
import type { AUTH_CONNECTION_TYPE, BUILD_ENV_TYPE, EMAIL_FLOW_TYPE, ExtraLoginOptions, LANGUAGES, SafeEventEmitter, THEME_MODE_TYPE, WEB3AUTH_NETWORK_TYPE } from "@web3auth/auth";
|
|
2
2
|
import { type AuthLoginParams, type BaseConnectorConfig, type ChainNamespaceType, type LoginMethodConfig, type LoginModalConfig, type UIConfig as CoreUIConfig, type WALLET_CONNECTOR_TYPE, type WalletRegistry, type WalletRegistryItem, type Web3AuthNoModalEvents } from "@web3auth/no-modal";
|
|
3
3
|
export interface UIConfig extends CoreUIConfig, LoginModalConfig {
|
|
4
4
|
/**
|
|
@@ -8,7 +8,7 @@ export interface UIConfig extends CoreUIConfig, LoginModalConfig {
|
|
|
8
8
|
/**
|
|
9
9
|
* order of how login methods are shown
|
|
10
10
|
*
|
|
11
|
-
* @defaultValue `["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "
|
|
11
|
+
* @defaultValue `["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "wechat", "email_passwordless"]`
|
|
12
12
|
*/
|
|
13
13
|
loginMethodsOrder?: string[];
|
|
14
14
|
/**
|
|
@@ -46,6 +46,7 @@ export interface LoginModalProps extends UIConfig {
|
|
|
46
46
|
walletRegistry: WalletRegistry;
|
|
47
47
|
web3authClientId: string;
|
|
48
48
|
web3authNetwork: WEB3AUTH_NETWORK_TYPE;
|
|
49
|
+
authBuildEnv: BUILD_ENV_TYPE;
|
|
49
50
|
}
|
|
50
51
|
export interface LoginModalCallbacks {
|
|
51
52
|
onInitExternalWallets: (params: {
|
|
@@ -96,6 +97,7 @@ export interface ModalState {
|
|
|
96
97
|
currentPage?: string;
|
|
97
98
|
web3authClientId: string;
|
|
98
99
|
web3authNetwork: WEB3AUTH_NETWORK_TYPE;
|
|
100
|
+
authBuildEnv: BUILD_ENV_TYPE;
|
|
99
101
|
}
|
|
100
102
|
export type SocialLoginEventType = {
|
|
101
103
|
connector: string;
|
|
@@ -140,13 +142,13 @@ export type rowType = {
|
|
|
140
142
|
extraLoginOptions?: ExtraLoginOptions;
|
|
141
143
|
};
|
|
142
144
|
order: number;
|
|
143
|
-
isMainOption: boolean;
|
|
144
145
|
};
|
|
145
146
|
export type PasswordlessHandlerParams = {
|
|
146
147
|
authConnection: AUTH_CONNECTION_TYPE;
|
|
147
148
|
web3authClientId: string;
|
|
148
149
|
loginHint: string;
|
|
149
150
|
network: string;
|
|
151
|
+
authBuildEnv?: BUILD_ENV_TYPE;
|
|
150
152
|
uiConfig?: Omit<UIConfig, "connectorListener">;
|
|
151
153
|
};
|
|
152
154
|
export interface WhiteLabelParams {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
-
import { Web3AuthNoModal, cloneDeep, WALLET_CONNECTORS, log, CONNECTOR_STATUS, CONNECTOR_EVENTS, WalletInitializationError, fetchProjectConfig, fetchWalletRegistry, CONNECTOR_CATEGORY, CONNECTOR_NAMES, CONNECTOR_NAMESPACES } from '@web3auth/no-modal';
|
|
3
|
+
import { Web3AuthNoModal, cloneDeep, WALLET_CONNECTORS, log, CONNECTOR_STATUS, withAbort, CONNECTOR_EVENTS, WalletInitializationError, fetchProjectConfig, fetchWalletRegistry, CONNECTOR_CATEGORY, CONNECTOR_NAMES, CONNECTOR_NAMESPACES } from '@web3auth/no-modal';
|
|
4
4
|
import deepmerge from 'deepmerge';
|
|
5
5
|
import { defaultConnectorsModalConfig, walletRegistryUrl } from './config.js';
|
|
6
6
|
import { AUTH_PROVIDERS_NAMES, AUTH_PROVIDERS, capitalizeFirstLetter } from './ui/config.js';
|
|
@@ -71,19 +71,19 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
71
71
|
if (this.options.modalConfig) this.modalConfig = this.options.modalConfig;
|
|
72
72
|
log.info("modalConfig", this.modalConfig);
|
|
73
73
|
}
|
|
74
|
-
async initModal() {
|
|
74
|
+
async initModal(options) {
|
|
75
|
+
const {
|
|
76
|
+
signal
|
|
77
|
+
} = options || {};
|
|
75
78
|
super.checkInitRequirements();
|
|
76
79
|
// get project config and wallet registry
|
|
77
80
|
const {
|
|
78
81
|
projectConfig,
|
|
79
82
|
walletRegistry
|
|
80
83
|
} = await this.getProjectAndWalletConfig();
|
|
81
|
-
this.options.uiConfig = deepmerge(cloneDeep(projectConfig.whitelabel || {}), this.options.uiConfig || {});
|
|
82
|
-
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
83
|
-
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
84
|
-
this.options.uiConfig = deepmerge(projectConfig.loginModal || {}, this.options.uiConfig || {});
|
|
85
84
|
|
|
86
85
|
// init config
|
|
86
|
+
this.initUIConfig(projectConfig);
|
|
87
87
|
super.initAccountAbstractionConfig(projectConfig);
|
|
88
88
|
super.initChainsConfig(projectConfig);
|
|
89
89
|
super.initCachedConnectorAndChainId();
|
|
@@ -97,6 +97,7 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
97
97
|
connectorListener: this,
|
|
98
98
|
web3authClientId: this.options.clientId,
|
|
99
99
|
web3authNetwork: this.options.web3AuthNetwork,
|
|
100
|
+
authBuildEnv: this.options.authBuildEnv,
|
|
100
101
|
chainNamespaces: this.getChainNamespaces(),
|
|
101
102
|
walletRegistry: filteredWalletRegistry
|
|
102
103
|
}), {
|
|
@@ -105,25 +106,34 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
105
106
|
onExternalWalletLogin: this.onExternalWalletLogin,
|
|
106
107
|
onModalVisibility: this.onModalVisibility
|
|
107
108
|
});
|
|
108
|
-
await this.loginModal.initModal();
|
|
109
|
+
await withAbort(() => this.loginModal.initModal(), signal);
|
|
109
110
|
|
|
110
111
|
// setup common JRPC provider
|
|
111
|
-
await this.setupCommonJRPCProvider();
|
|
112
|
+
await withAbort(() => this.setupCommonJRPCProvider(), signal);
|
|
112
113
|
|
|
113
114
|
// initialize connectors
|
|
114
115
|
this.on(CONNECTOR_EVENTS.CONNECTORS_UPDATED, ({
|
|
115
116
|
connectors: newConnectors
|
|
116
|
-
}) =>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
}) => {
|
|
118
|
+
const onAbortHandler = () => {
|
|
119
|
+
var _this$connectors;
|
|
120
|
+
log.debug("init aborted");
|
|
121
|
+
if (((_this$connectors = this.connectors) === null || _this$connectors === void 0 ? void 0 : _this$connectors.length) > 0) {
|
|
122
|
+
super.cleanup();
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
withAbort(() => this.initConnectors({
|
|
126
|
+
connectors: newConnectors,
|
|
127
|
+
projectConfig,
|
|
128
|
+
disabledExternalWallets
|
|
129
|
+
}), signal, onAbortHandler);
|
|
123
130
|
});
|
|
131
|
+
await withAbort(() => super.loadConnectors({
|
|
132
|
+
projectConfig
|
|
133
|
+
}), signal);
|
|
124
134
|
|
|
125
135
|
// initialize plugins
|
|
126
|
-
await
|
|
136
|
+
await withAbort(() => super.initPlugins(), signal);
|
|
127
137
|
}
|
|
128
138
|
async connect() {
|
|
129
139
|
if (!this.loginModal) throw WalletInitializationError.notReady("Login modal is not initialized");
|
|
@@ -219,6 +229,24 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
219
229
|
walletRegistry
|
|
220
230
|
};
|
|
221
231
|
}
|
|
232
|
+
initUIConfig(projectConfig) {
|
|
233
|
+
this.options.uiConfig = deepmerge(cloneDeep(projectConfig.whitelabel || {}), this.options.uiConfig || {});
|
|
234
|
+
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
235
|
+
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
236
|
+
this.options.uiConfig = deepmerge(projectConfig.loginModal || {}, this.options.uiConfig);
|
|
237
|
+
|
|
238
|
+
// merge login methods order from project config and user config, with user config taking precedence
|
|
239
|
+
const defaultAuthConnections = projectConfig.embeddedWalletAuth.filter(x => x.isDefault).map(x => x.authConnection);
|
|
240
|
+
const mergedAuthConnections = [...(this.options.uiConfig.loginMethodsOrder || []), ...defaultAuthConnections];
|
|
241
|
+
const loginMethodsOrder = [];
|
|
242
|
+
const authConnectionSet = new Set();
|
|
243
|
+
for (const authConnection of mergedAuthConnections) {
|
|
244
|
+
if (authConnectionSet.has(authConnection)) continue;
|
|
245
|
+
authConnectionSet.add(authConnection);
|
|
246
|
+
loginMethodsOrder.push(authConnection);
|
|
247
|
+
}
|
|
248
|
+
this.options.uiConfig.loginMethodsOrder = loginMethodsOrder;
|
|
249
|
+
}
|
|
222
250
|
async initConnectors({
|
|
223
251
|
connectors,
|
|
224
252
|
projectConfig,
|
|
@@ -288,9 +316,7 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
288
316
|
groupedAuthConnectionId: groupedAuthConnectionId,
|
|
289
317
|
extraLoginOptions: authConnectionConfig.jwtParameters,
|
|
290
318
|
isDefault: true,
|
|
291
|
-
showOnModal: true
|
|
292
|
-
showOnDesktop: true,
|
|
293
|
-
showOnMobile: true
|
|
319
|
+
showOnModal: true
|
|
294
320
|
};
|
|
295
321
|
}
|
|
296
322
|
embedWalletConfigMap.set(groupedAuthConnectionId || authConnectionId, authConnectionConfig);
|
|
@@ -339,9 +365,7 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
339
365
|
// start with the default config of connector.
|
|
340
366
|
const defaultConnectorConfig = {
|
|
341
367
|
label: CONNECTOR_NAMES[connectorName] || connectorName.split("-").map(capitalizeFirstLetter).join(" "),
|
|
342
|
-
showOnModal: true
|
|
343
|
-
showOnMobile: true,
|
|
344
|
-
showOnDesktop: true
|
|
368
|
+
showOnModal: true
|
|
345
369
|
};
|
|
346
370
|
this.modalConfig.connectors[connectorName] = _objectSpread(_objectSpread({}, defaultConnectorConfig), ((_this$modalConfig3 = this.modalConfig) === null || _this$modalConfig3 === void 0 || (_this$modalConfig3 = _this$modalConfig3.connectors) === null || _this$modalConfig3 === void 0 ? void 0 : _this$modalConfig3[connectorName]) || {});
|
|
347
371
|
|
|
@@ -81,11 +81,14 @@ function Web3AuthInnerProvider(params) {
|
|
|
81
81
|
setWeb3Auth(web3AuthInstance);
|
|
82
82
|
}, [config]);
|
|
83
83
|
useEffect(() => {
|
|
84
|
+
const controller = new AbortController();
|
|
84
85
|
async function init() {
|
|
85
86
|
try {
|
|
86
87
|
setInitError(null);
|
|
87
88
|
setIsInitializing(true);
|
|
88
|
-
await web3Auth.initModal(
|
|
89
|
+
await web3Auth.initModal({
|
|
90
|
+
signal: controller.signal
|
|
91
|
+
});
|
|
89
92
|
} catch (error) {
|
|
90
93
|
setInitError(error);
|
|
91
94
|
} finally {
|
|
@@ -93,6 +96,9 @@ function Web3AuthInnerProvider(params) {
|
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
if (web3Auth) init();
|
|
99
|
+
return () => {
|
|
100
|
+
controller.abort();
|
|
101
|
+
};
|
|
96
102
|
}, [web3Auth, config]);
|
|
97
103
|
useEffect(() => {
|
|
98
104
|
const addState = async () => {
|
|
@@ -152,6 +158,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
152
158
|
web3Auth.off(CONNECTOR_EVENTS.DISCONNECTED, disconnectedListener);
|
|
153
159
|
web3Auth.off(CONNECTOR_EVENTS.CONNECTING, connectingListener);
|
|
154
160
|
web3Auth.off(CONNECTOR_EVENTS.ERRORED, errorListener);
|
|
161
|
+
web3Auth.cleanup();
|
|
155
162
|
}
|
|
156
163
|
};
|
|
157
164
|
}, [web3Auth]);
|
|
@@ -42,7 +42,7 @@ function BottomSheet({
|
|
|
42
42
|
fill: "none",
|
|
43
43
|
xmlns: "http://www.w3.org/2000/svg",
|
|
44
44
|
onClick: onClose,
|
|
45
|
-
className: "w3a--text-app-gray-500 dark:w3a--text-app-gray-200",
|
|
45
|
+
className: "w3a--text-app-gray-500 hover:w3a--text-app-gray-900 dark:w3a--text-app-gray-200 dark:hover:w3a--text-app-white",
|
|
46
46
|
children: /*#__PURE__*/jsx("path", {
|
|
47
47
|
fillRule: "evenodd",
|
|
48
48
|
clipRule: "evenodd",
|
|
@@ -4,7 +4,7 @@ import Image from '../../Image/Image.js';
|
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
function getProviderIcon(method, isDark, isPrimaryBtn) {
|
|
7
|
-
const imageId = method === AUTH_CONNECTION.TWITTER ? `login-
|
|
7
|
+
const imageId = method === AUTH_CONNECTION.TWITTER ? `login-X${isDark ? "-light" : "-dark"}` : `login-${method}${isDark ? "-light" : "-dark"}`;
|
|
8
8
|
const hoverId = method === AUTH_CONNECTION.APPLE || method === AUTH_CONNECTION.GITHUB || method === AUTH_CONNECTION.TWITTER ? imageId : `login-${method}-active`;
|
|
9
9
|
if (isPrimaryBtn) {
|
|
10
10
|
return /*#__PURE__*/jsx(Image, {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import cn from 'classnames';
|
|
2
|
-
import { useMemo } from 'react';
|
|
2
|
+
import { useContext, useMemo } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ThemedContext } from '../../../context/ThemeContext.js';
|
|
4
5
|
import i18nInstance from '../../../localeImport.js';
|
|
5
|
-
import { formatIOSMobile } from '../../../utils.js';
|
|
6
|
+
import { formatIOSMobile, getIcons } from '../../../utils.js';
|
|
6
7
|
import Image from '../../Image/Image.js';
|
|
7
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
9
|
|
|
@@ -18,6 +19,7 @@ function ButtonWallet(props) {
|
|
|
18
19
|
label,
|
|
19
20
|
buttonRadius
|
|
20
21
|
} = props;
|
|
22
|
+
const isDark = useContext(ThemedContext);
|
|
21
23
|
const isLink = useMemo(() => deviceDetails.platform !== "desktop" && button.href && button.hasWalletConnect && !button.hasInjectedWallet, [deviceDetails, button]);
|
|
22
24
|
const href = useMemo(() => button.href ? formatIOSMobile({
|
|
23
25
|
uri: walletConnectUri,
|
|
@@ -32,7 +34,8 @@ function ButtonWallet(props) {
|
|
|
32
34
|
};
|
|
33
35
|
return /*#__PURE__*/jsxs("button", {
|
|
34
36
|
type: "button",
|
|
35
|
-
className: cn(`w3a--flex w3a--w-full w3a--items-center w3a--justify-between w3a--bg-app-gray-50 w3a--p-3 hover:w3a--bg-app-gray-200
|
|
37
|
+
className: cn(`w3a--group w3a--relative w3a--overflow-hidden w3a--flex w3a--w-full w3a--items-center w3a--justify-between w3a--bg-app-gray-50 w3a--p-3 hover:w3a--bg-app-gray-200
|
|
38
|
+
hover:w3a--text-app-gray-900 dark:w3a--bg-app-gray-800 dark:hover:w3a--bg-app-gray-600 active:w3a--scale-95 w3a--transition-all w3a--duration-150`, {
|
|
36
39
|
"w3a--rounded-full": buttonRadius === "pill",
|
|
37
40
|
"w3a--rounded-lg": buttonRadius === "rounded",
|
|
38
41
|
"w3a--rounded-none": buttonRadius === "square"
|
|
@@ -41,7 +44,7 @@ function ButtonWallet(props) {
|
|
|
41
44
|
children: [/*#__PURE__*/jsxs("div", {
|
|
42
45
|
className: "w3a--flex w3a--items-center w3a--gap-x-2",
|
|
43
46
|
children: [/*#__PURE__*/jsx("figure", {
|
|
44
|
-
className:
|
|
47
|
+
className: "w3a--size-5",
|
|
45
48
|
children: /*#__PURE__*/jsx(Image, {
|
|
46
49
|
imageData: button.icon,
|
|
47
50
|
imageId: `login-${button.name}`,
|
|
@@ -53,12 +56,17 @@ function ButtonWallet(props) {
|
|
|
53
56
|
extension: button.imgExtension || "webp"
|
|
54
57
|
})
|
|
55
58
|
}), /*#__PURE__*/jsx("p", {
|
|
56
|
-
className: "w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
|
|
59
|
+
className: "w3a--max-w-[180px] w3a--truncate w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
|
|
57
60
|
children: label
|
|
58
61
|
})]
|
|
59
62
|
}), button.hasInjectedWallet && /*#__PURE__*/jsx("span", {
|
|
60
|
-
className: "w3a--
|
|
63
|
+
className: "w3a--absolute w3a--right-4 w3a--top-1/2 w3a--flex w3a--w-auto -w3a--translate-y-1/2 w3a--items-center w3a--rounded-md w3a--bg-app-primary-100 w3a--px-2 w3a--py-1 w3a--text-xs w3a--font-medium w3a--text-app-primary-800 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-6 group-hover:w3a--opacity-0 dark:w3a--border dark:w3a--border-app-primary-400 dark:w3a--bg-transparent dark:w3a--text-app-primary-400",
|
|
61
64
|
children: t("modal.external.installed")
|
|
65
|
+
}), /*#__PURE__*/jsx("img", {
|
|
66
|
+
id: "injected-wallet-arrow",
|
|
67
|
+
className: "w3a--absolute w3a--right-4 w3a--top-1/2 -w3a--translate-x-10 -w3a--translate-y-1/2 w3a--opacity-0 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
|
|
68
|
+
src: getIcons(isDark ? "chevron-right-light" : "chevron-right-dark"),
|
|
69
|
+
alt: "arrow"
|
|
62
70
|
})]
|
|
63
71
|
});
|
|
64
72
|
}
|
|
@@ -57,7 +57,7 @@ function ConnectWallet(props) {
|
|
|
57
57
|
}, [walletRegistry]);
|
|
58
58
|
const allUniqueButtons = useMemo(() => {
|
|
59
59
|
const uniqueButtonSet = new Set();
|
|
60
|
-
return
|
|
60
|
+
return customConnectorButtons.concat(allExternalButtons).filter(button => {
|
|
61
61
|
if (uniqueButtonSet.has(button.name)) return false;
|
|
62
62
|
uniqueButtonSet.add(button.name);
|
|
63
63
|
return true;
|
|
@@ -102,7 +102,7 @@ function ConnectWallet(props) {
|
|
|
102
102
|
};
|
|
103
103
|
const filteredButtons = useMemo(() => {
|
|
104
104
|
if (walletDiscoverySupported) {
|
|
105
|
-
return allUniqueButtons.filter(button => selectedChain === "all" || button.chainNamespaces.includes(selectedChain)).filter(button => button.name.toLowerCase().includes(walletSearch.toLowerCase()));
|
|
105
|
+
return [...allUniqueButtons.filter(button => button.hasInjectedWallet), ...allUniqueButtons.filter(button => !button.hasInjectedWallet)].filter(button => selectedChain === "all" || button.chainNamespaces.includes(selectedChain)).filter(button => button.name.toLowerCase().includes(walletSearch.toLowerCase()));
|
|
106
106
|
}
|
|
107
107
|
return installedWalletButtons;
|
|
108
108
|
}, [walletDiscoverySupported, installedWalletButtons, walletSearch, allUniqueButtons, selectedChain]);
|
|
@@ -41,11 +41,11 @@ function ConnectWalletChainFilter(props) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
return /*#__PURE__*/jsx("div", {
|
|
44
|
-
className: "w3a--flex w3a--items-center w3a--justify-items-start w3a--gap-x-
|
|
44
|
+
className: "w3a--flex w3a--items-center w3a--justify-items-start w3a--gap-x-4",
|
|
45
45
|
children: chains.map(chain => /*#__PURE__*/jsxs("button", {
|
|
46
46
|
type: "button",
|
|
47
|
-
className: cn("w3a--flex w3a--items-center w3a--justify-center w3a--gap-x-1 w3a--text-xs w3a--font-medium w3a--px-4 w3a--py-3 w3a--text-app-gray-500 dark:w3a--text-app-gray-300 hover:w3a--bg-app-gray-200 dark:hover:w3a--bg-app-gray-700 w3a--h-12 w3a--rounded-2xl", {
|
|
48
|
-
"w3a--bg-app-gray-100 dark:w3a--bg-app-gray-800 w3a--border
|
|
47
|
+
className: cn("w3a--flex w3a--w-[104px] w3a--items-center w3a--justify-center w3a--gap-x-1 w3a--text-xs w3a--font-medium w3a--px-4 w3a--py-3 w3a--text-app-gray-500 dark:w3a--text-app-gray-300 hover:w3a--bg-app-gray-200 dark:hover:w3a--bg-app-gray-700 w3a--h-12 w3a--rounded-2xl w3a--border w3a--border-transparent", {
|
|
48
|
+
"w3a--bg-app-gray-100 dark:w3a--bg-app-gray-800 w3a--border-app-gray-200 dark:w3a--border-app-gray-700 w3a--text-app-gray-900 dark:w3a--text-app-white hover:!w3a--bg-app-gray-100 dark:hover:!w3a--bg-app-gray-800": selectedChain === chain.id
|
|
49
49
|
}),
|
|
50
50
|
onClick: () => setSelectedChain(chain.id),
|
|
51
51
|
children: [chain.icon && /*#__PURE__*/jsx("img", {
|
|
@@ -54,7 +54,7 @@ const ConnectWalletChainNamespaceSelect = props => {
|
|
|
54
54
|
}) => /*#__PURE__*/jsx("li", {
|
|
55
55
|
children: /*#__PURE__*/jsxs("button", {
|
|
56
56
|
type: "button",
|
|
57
|
-
className: "w3a--btn w3a
|
|
57
|
+
className: "w3a--btn w3a--group w3a--relative w3a--h-11 w3a--w-full w3a--items-center !w3a--justify-between w3a--overflow-hidden w3a--rounded-full",
|
|
58
58
|
onClick: () => handleExternalWalletClick({
|
|
59
59
|
connector: wallet.name,
|
|
60
60
|
chainNamespace
|
|
@@ -74,8 +74,8 @@ const ConnectWalletChainNamespaceSelect = props => {
|
|
|
74
74
|
children: displayName
|
|
75
75
|
})]
|
|
76
76
|
}), /*#__PURE__*/jsx("img", {
|
|
77
|
-
id: "
|
|
78
|
-
className: "w3a--
|
|
77
|
+
id: "chain-namespace-arrow",
|
|
78
|
+
className: "w3a--absolute w3a--right-4 w3a--top-1/2 -w3a--translate-x-6 -w3a--translate-y-1/2 w3a--opacity-0 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
|
|
79
79
|
src: getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
80
80
|
alt: "arrow"
|
|
81
81
|
})]
|