From 691221f393ad182ea33d224ed259c7cd325aaef6 Mon Sep 17 00:00:00 2001 From: Adam Cohen Hillel Date: Fri, 18 Apr 2025 12:12:21 +0100 Subject: [PATCH 1/8] fix google --- frontend/src/components/GoogleSignIn.tsx | 86 ++++++++++-------------- 1 file changed, 37 insertions(+), 49 deletions(-) diff --git a/frontend/src/components/GoogleSignIn.tsx b/frontend/src/components/GoogleSignIn.tsx index 0946a7f4..452298f5 100644 --- a/frontend/src/components/GoogleSignIn.tsx +++ b/frontend/src/components/GoogleSignIn.tsx @@ -43,6 +43,8 @@ interface GoogleButtonOptions { size?: string; text?: string; shape?: string; + logoAlignment?: string; + width?: number; } interface GoogleNotification { @@ -60,7 +62,6 @@ interface GoogleSignInProps { export default function GoogleSignIn({ returnUrl }: GoogleSignInProps) { const googleClientId = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID; - const buttonRef = useRef(null); const [isLoading, setIsLoading] = useState(false); const handleGoogleSignIn = useCallback(async (response: GoogleSignInResponse) => { @@ -80,12 +81,6 @@ export default function GoogleSignIn({ returnUrl }: GoogleSignInProps) { } }, [returnUrl]); - const handleCustomButtonClick = useCallback(() => { - if (window.google) { - window.google.accounts.id.prompt(); - } - }, []); - useEffect(() => { // Assign the callback to window object so it can be called from the Google button window.handleGoogleSignIn = handleGoogleSignIn; @@ -128,7 +123,7 @@ export default function GoogleSignIn({ returnUrl }: GoogleSignInProps) { return ( <> - {/* Hidden div for One Tap popup */} + {/* Google One Tap container */}
- {/* Custom Google button that matches site style */} - - - {/* Hidden original Google button with no styles */} -
+ {/* Google Sign-In button container styled to match site design */} +
+ {/* The Google button will be rendered here */} +