Skip to content

Commit

Permalink
🎨 Set the login social options as a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Jul 16, 2024
1 parent 5f187b7 commit 40d1747
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const SESSION_KEY = 'likecoin_wallet_connector_session';

const WC_BRIGDE = 'https://bridge.walletconnect.org';

const SOCIAL_LOGIN_OPTIONS = {
HIDE_SOCIAL: 'likecoin-app-hidesocial',
DEFAULT: 'likecoin-app',
};

export class LikeCoinWalletConnector {
public options: LikeCoinWalletConnectorOptions;

Expand Down Expand Up @@ -132,7 +137,7 @@ export class LikeCoinWalletConnector {
: true,

language: options.language || 'en',
authcoreClientId: options.authcoreClientId || 'likecoin-app',
authcoreClientId: options.authcoreClientId || SOCIAL_LOGIN_OPTIONS.DEFAULT,
authcoreApiHost: options.authcoreApiHost || 'https://authcore.like.co',
authcoreRedirectUrl: options.authcoreRedirectUrl || '',

Expand Down Expand Up @@ -350,7 +355,7 @@ export class LikeCoinWalletConnector {
init = async (
methodType: LikeCoinWalletConnectorMethodType,
params?: any,
language = this.options.language,
language = this.options.language
) => {
let initiator: Promise<LikeCoinWalletConnectorInitResponse>;

Expand All @@ -370,7 +375,12 @@ export class LikeCoinWalletConnector {
resolve(undefined);
this._events.emit('authcore_auth_closed');
}}
isHideSocialLogin={!!(this.options.authcoreClientId === 'likecoin-app-hidesocial')}
isHideSocialLogin={
!!(
this.options.authcoreClientId ===
SOCIAL_LOGIN_OPTIONS.HIDE_SOCIAL
)
}
/>
</IntlProvider>
);
Expand Down

0 comments on commit 40d1747

Please sign in to comment.