From 369dc2bc3d6f3ae5d99415fcf71cf4da360c8b23 Mon Sep 17 00:00:00 2001 From: "Ng Wing Tat, David" Date: Fri, 6 Sep 2024 00:05:26 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Provide=20option=20for=20Authcore?= =?UTF-8?q?=20social=20login=20pane=20position=20(#65)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.tsx | 2 ++ src/types.ts | 1 + src/utils/authcore.ts | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index f2856a3..fec6075 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -142,6 +142,8 @@ export class LikeCoinWalletConnector { options.authcoreClientId || SOCIAL_LOGIN_OPTIONS.DEFAULT, authcoreApiHost: options.authcoreApiHost || 'https://authcore.like.co', authcoreRedirectUrl: options.authcoreRedirectUrl || '', + authcoreSocialLoginPanePosition: + options.authcoreSocialLoginPanePosition || 'top', onEvent: options.onEvent || (() => {}), }; diff --git a/src/types.ts b/src/types.ts index 1c14616..2688ec0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -101,6 +101,7 @@ export interface LikeCoinWalletConnectorConfig { authcoreClientId?: string; authcoreApiHost?: string; authcoreRedirectUrl?: string; + authcoreSocialLoginPanePosition?: 'top' | 'bottom'; language?: string; diff --git a/src/utils/authcore.ts b/src/utils/authcore.ts index d8850af..ae62262 100644 --- a/src/utils/authcore.ts +++ b/src/utils/authcore.ts @@ -70,7 +70,7 @@ export async function initAuthcore( container: containerId, root: `${authcoreApiHost}/widgets`, initialScreen: initialScreen, - socialLoginPaneStyle: 'top', + socialLoginPaneStyle: options.authcoreSocialLoginPanePosition, socialLoginPaneOption: 'grid', internal: true, language: options.language?.toLowerCase().includes('zh') ? 'zh-hk' : 'en',