From 0f07e8436d04839eae16b3ee85e450d2f174a1ce Mon Sep 17 00:00:00 2001 From: Sajad Mirjalili Date: Fri, 28 Nov 2025 16:47:29 +0330 Subject: [PATCH] fix: replace google button with custom mui button --- .../GoogleAuthenticationV2.tsx | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/features/authentication/components/AuthenticationSteps/GoogleAuthenticationV2.tsx b/src/features/authentication/components/AuthenticationSteps/GoogleAuthenticationV2.tsx index 44dd66e..2182a73 100644 --- a/src/features/authentication/components/AuthenticationSteps/GoogleAuthenticationV2.tsx +++ b/src/features/authentication/components/AuthenticationSteps/GoogleAuthenticationV2.tsx @@ -10,9 +10,10 @@ import { } from '../../api/identityAPI'; import { loginOrSignUpWithGoogle } from '../../api/authorizationAPI'; import { useApi } from '@/hooks/useApi'; -import { useToast } from '@rkheftan/harmony-ui'; +import { Icon, useToast } from '@rkheftan/harmony-ui'; import { useTranslation } from 'react-i18next'; import { Box, Button } from '@mui/material'; +import { Google } from 'iconsax-react'; interface GoogleAuthenticationV2Props { authFactory: AuthFactory; @@ -28,7 +29,9 @@ export const GoogleAuthenticationV2 = ({ }: GoogleAuthenticationV2Props) => { const toast = useToast(); const { t } = useTranslation('authentication'); - const { execute: loginWithGoogleCall } = useApi(loginOrSignUpWithGoogle); + const { execute: loginWithGoogleCall, loading } = useApi( + loginOrSignUpWithGoogle, + ); const [isGoogleLoaded, setIsGoogleLoaded] = useState(false); const googleBtnRef = useRef(null); @@ -110,6 +113,15 @@ export const GoogleAuthenticationV2 = ({ } }, []); + const handleGoogleLogin = () => { + if (googleBtnRef.current) { + const googleCustomRenderedDivs = + googleBtnRef.current.querySelectorAll('div'); + + googleCustomRenderedDivs.forEach((b) => b.click()); + } + }; + return ( <> - {!isGoogleLoaded && +
);