diff --git a/src/components/authcore-dialog.tsx b/src/components/authcore-dialog.tsx index 3375fc7..bbe4f20 100644 --- a/src/components/authcore-dialog.tsx +++ b/src/components/authcore-dialog.tsx @@ -31,18 +31,34 @@ export const AuthcoreDialog: FC = ({ onClose={closeDialog} >
- {isHideSocialLogin && ( -
-

- {chunks}, - }} + +

); }; diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index 9a88f3d..3fbb515 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -22,7 +22,10 @@ "wallet_connect_header_title_open_app": "Launch App", "wallet_connect_header_title_scan_qrcode": "Scan QR Code", "wallet_connect_hint_approve": "Please approve the connection request in the app by clicking the button below.", - "wallet_connect_hint_reset_password": "If you can't find your login method,reset your password.", + "wallet_connect_hint_browser_warning": "Third-party browsers, VPN, or private browsing may cause issue.", + + "wallet_connect_hint_reset_password": "If your login method is not available here, please reset your password.", + "wallet_connect_hint_scan_qrcode_cosmostation_mobile": "Please scan the QR code with Cosmostation Mobile Wallet app", "wallet_connect_hint_scan_qrcode_keplr_mobile": "Please scan the QR code with Keplr Mobile Wallet app", "wallet_connect_hint_scan_qrcode_liker_land_app": "Please scan the QR code with Liker Land app", diff --git a/src/i18n/translations/zh.json b/src/i18n/translations/zh.json index a0ad26f..40cffc8 100644 --- a/src/i18n/translations/zh.json +++ b/src/i18n/translations/zh.json @@ -12,8 +12,8 @@ "connect_wallet_method_description_keplr": "使用 Keplr 瀏覽器外掛", "connect_wallet_method_description_keplr_mobile": "使用 Keplr Mobile app 掃描二維碼", "connect_wallet_method_description_leap": "使用 Leap 瀏覽器外掛", - "connect_wallet_method_description_metamask": "使用 MetaMask 瀏覽器外掛 Snap", "connect_wallet_method_description_liker_land_app": "使用 Liker Land app 掃描二維碼", + "connect_wallet_method_description_metamask": "使用 MetaMask 瀏覽器外掛 Snap", "connect_wallet_method_description_wallet_connect_v2": "使用支援 Wallet Connect V2 的錢包掃描二維碼", "connect_wallet_other_methods": "其他連接方法", "connect_wallet_title": "連接錢包", @@ -22,7 +22,8 @@ "wallet_connect_header_title_open_app": "啟動 App", "wallet_connect_header_title_scan_qrcode": "掃描二維碼", "wallet_connect_hint_approve": "請點擊以下按鈕打開 App 並批准連接請求。", - "wallet_connect_hint_reset_password": "若找不到您原先的登入方式,請重設密碼。", + "wallet_connect_hint_browser_warning": "使用第三方瀏覽器、 VPN 或私密瀏覽可能無法登入。", + "wallet_connect_hint_reset_password": "找不到登入方式?請嘗試重設密碼。", "wallet_connect_hint_scan_qrcode_cosmostation_mobile": "請使用 Cosmostation Mobile Wallet app 掃描二維碼", "wallet_connect_hint_scan_qrcode_keplr_mobile": "請使用 Keplr Mobile app 掃描二維碼", "wallet_connect_hint_scan_qrcode_liker_land_app": "請使用 Liker Land app 掃描二維碼", diff --git a/src/index.tsx b/src/index.tsx index e0fefc6..f2856a3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -138,7 +138,8 @@ export class LikeCoinWalletConnector { : true, language: options.language || 'en', - authcoreClientId: options.authcoreClientId || SOCIAL_LOGIN_OPTIONS.DEFAULT, + authcoreClientId: + options.authcoreClientId || SOCIAL_LOGIN_OPTIONS.DEFAULT, authcoreApiHost: options.authcoreApiHost || 'https://authcore.like.co', authcoreRedirectUrl: options.authcoreRedirectUrl || '', @@ -371,9 +372,14 @@ export class LikeCoinWalletConnector { { const intervalId = setInterval(() => { - const containerElement = document.getElementById(containerId); + const containerElement = document.getElementById( + containerId + ); if (containerElement) { - initAuthcore(this.options, { containerId, initialScreen }); + initAuthcore(this.options, { + containerId, + initialScreen, + }); clearInterval(intervalId); } }, 200); @@ -394,7 +400,10 @@ export class LikeCoinWalletConnector { ); }); } else { - initiator = initAuthcore(this.options, { accessToken, initialScreen }); + initiator = initAuthcore(this.options, { + accessToken, + initialScreen, + }); } break; diff --git a/src/types.ts b/src/types.ts index 34c0552..1c14616 100644 --- a/src/types.ts +++ b/src/types.ts @@ -49,7 +49,7 @@ export type LikeCoinWalletConnectorEvent = method: LikeCoinWalletConnectorMethodType; }; -export type AuthCoreInitialScreen = 'signin' | 'register' +export type AuthCoreInitialScreen = 'signin' | 'register'; export interface LikeCoinWalletConnectorConfig { chainId: string; diff --git a/src/utils/authcore.ts b/src/utils/authcore.ts index aa73d37..d8850af 100644 --- a/src/utils/authcore.ts +++ b/src/utils/authcore.ts @@ -15,7 +15,7 @@ import { AuthCoreAuthClient, AuthCoreWidgets } from '@likecoin/authcore-js'; import { LikeCoinWalletConnectorInitResponse, LikeCoinWalletConnectorOptions, - AuthCoreInitialScreen + AuthCoreInitialScreen, } from '../types'; import { convertAddressPrefix } from './wallet'; @@ -32,7 +32,7 @@ export async function initAuthcore( accessToken?: string; containerId?: string; initialScreen?: AuthCoreInitialScreen; - } = {}, + } = {} ): Promise { const authcoreApiHost = options.authcoreApiHost;