edit yandex button behavior

This commit is contained in:
smanylov
2026-01-14 13:26:18 +07:00
parent e53a85caa2
commit f790a95e71
2 changed files with 18 additions and 7 deletions
+7
View File
@@ -12,6 +12,7 @@ declare global {
export default function YandexAuthWithScript() {
const buttonRef = useRef<HTMLDivElement>(null);
const [isReady, setIsReady] = useState(false);
const [showButton, setShowButton] = useState(true);
const handleLogin = (token: string) => {
console.log('handleLogin');
@@ -41,6 +42,10 @@ export default function YandexAuthWithScript() {
console.log(result);
if (result?.access_token) {
handleLogin(result.access_token);
} else {
setTimeout(() => {
setShowButton(false);
}, 1000)
}
})
.catch((error: any) => {
@@ -57,6 +62,7 @@ export default function YandexAuthWithScript() {
onError={() => console.error('Failed to load Yandex script')}
/>
{showButton && (
<div
ref={buttonRef}
id="yandex-auth-container"
@@ -64,6 +70,7 @@ export default function YandexAuthWithScript() {
>
{!isReady && <div>Загрузка Яндекс авторизации...</div>}
</div>
)}
</>
);
}
+4
View File
@@ -1824,3 +1824,7 @@
width: 100% !important;
}
}
.yaPreloadingSuggestBlockContainer {
height: 52px !important;
}