This commit is contained in:
arrelin
2026-01-23 12:23:25 +03:00
parent a3e941b19f
commit 71f772f2b9
14 changed files with 569 additions and 131 deletions

View File

@@ -1,8 +1,10 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { authApi } from '../api/client';
import { Loader2, Wallet } from 'lucide-react';
export default function Login() {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const [error, setError] = useState('');
@@ -14,7 +16,7 @@ export default function Login() {
const response = await authApi.getGoogleAuthUrl(currentUrl);
window.location.href = response.data.url;
} catch (err) {
setError('Ошибка при получении ссылки для авторизации');
setError(t('login.authError'));
console.error(err);
setLoading(false);
}
@@ -29,10 +31,10 @@ export default function Login() {
<Wallet className="w-12 h-12" />
</div>
<h1 className="text-3xl sm:text-4xl font-bold text-gray-900 mb-2">
Семейный бюджет
{t('login.title')}
</h1>
<p className="text-gray-600">
Войдите, чтобы продолжить
{t('login.subtitle')}
</p>
</div>
@@ -69,7 +71,7 @@ export default function Login() {
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
/>
</svg>
Войти через Google
{t('login.googleButton')}
</>
)}
</button>