diff --git a/packages/auth/components/TelegramAuthButton.tsx b/packages/auth/components/TelegramAuthButton.tsx index e21e707c..96badaab 100644 --- a/packages/auth/components/TelegramAuthButton.tsx +++ b/packages/auth/components/TelegramAuthButton.tsx @@ -1,7 +1,10 @@ 'use client'; +import { Button } from '@session/ui/ui/button'; import { LoginButton } from '@telegram-auth/react'; +import { TelegramIcon } from 'icons/TelegramIcon'; import { forwardRef } from 'react'; +import { ButtonDataTestId } from 'testing/data-test-ids'; import { signIn, signOut, useSession } from '../lib/client'; type TelegramAuthButtonProps = React.ButtonHTMLAttributes & { @@ -20,8 +23,15 @@ export const TelegramAuthButton = forwardRef { + if (!isConnected) { + /** @ts-expect-error -- Exists at runtime */ + return TWidgetLogin.auth(); + } + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any - const handleClick = (data: any) => { + const handleAuth = (data: any) => { if (!isConnected) { signIn('telegram', {}, data); } else { @@ -32,10 +42,10 @@ export const TelegramAuthButton = forwardRef - {/*
*/} - - {/*
*/} - {/* */} + ); }