From f40eb1add13824884302046e81a07a8836b22edf Mon Sep 17 00:00:00 2001 From: Dakshesh Jain Date: Fri, 28 Jul 2023 19:21:55 +0530 Subject: [PATCH] fix: google not accepting width as string --- apps/app/components/account/google-login.tsx | 28 +++++++++++--------- apps/app/google.d.ts | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/apps/app/components/account/google-login.tsx b/apps/app/components/account/google-login.tsx index 67a77f2e4..c814c658c 100644 --- a/apps/app/components/account/google-login.tsx +++ b/apps/app/components/account/google-login.tsx @@ -20,17 +20,21 @@ export const GoogleLoginButton: FC = ({ handleSignIn }) => { callback: handleSignIn, }); - window?.google?.accounts.id.renderButton( - googleSignInButton.current, - { - type: "standard", - theme: "outline", - size: "large", - logo_alignment: "center", - width: "360", - text: "signin_with", - } as GsiButtonConfiguration // customization attributes - ); + try { + window?.google?.accounts.id.renderButton( + googleSignInButton.current, + { + type: "standard", + theme: "outline", + size: "large", + logo_alignment: "center", + width: 360, + text: "signin_with", + } as GsiButtonConfiguration // customization attributes + ); + } catch (err) { + console.log(err); + } window?.google?.accounts.id.prompt(); // also display the One Tap dialog @@ -50,7 +54,7 @@ export const GoogleLoginButton: FC = ({ handleSignIn }) => { <>