+-good
This commit is contained in:
@@ -31,21 +31,25 @@ const AuthPage = () => {
|
||||
if (!isFormValid) return;
|
||||
|
||||
try {
|
||||
login(email, password); // редирект сделает сам контекст
|
||||
setAuthError("");
|
||||
login(email, password);
|
||||
} catch (err) {
|
||||
setAuthError(err.message);
|
||||
setAuthError(err.message || "Неверный логин или пароль");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen w-full bg-[#90D2F9] flex items-center justify-center px-4">
|
||||
<div className="w-full max-w-md bg-white/10 rounded-2xl p-6 sm:p-8 shadow-lg relative">
|
||||
{checkboxError && (
|
||||
{/* Красный баннер ошибок */}
|
||||
{(checkboxError || authError) && (
|
||||
<div
|
||||
className="absolute -top-10 left-0 w-full bg-red-500 text-white text-xs sm:text-sm font-montserrat px-3 py-2 rounded-t-2xl flex items-center justify-center shadow-md"
|
||||
role="alert"
|
||||
>
|
||||
Вы не согласны с условиями использования
|
||||
{checkboxError
|
||||
? "Вы не согласны с условиями использования"
|
||||
: authError || "Неверный логин или пароль"}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -107,31 +111,6 @@ const AuthPage = () => {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Ошибка авторизации */}
|
||||
{authError && (
|
||||
<p className="text-[11px] text-red-600 font-montserrat">
|
||||
{authError}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Ссылки */}
|
||||
<div className="flex justify-between text-[11px] font-montserrat font-bold text-[#FF6363] mt-1">
|
||||
<button
|
||||
type="button"
|
||||
className="hover:underline"
|
||||
onClick={() => router.push("/recPassword")}
|
||||
>
|
||||
Забыли пароль?
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="hover:underline"
|
||||
onClick={() => router.push("/reg")}
|
||||
>
|
||||
Регистрация
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Кнопка Войти */}
|
||||
<button
|
||||
type="submit"
|
||||
@@ -148,7 +127,7 @@ const AuthPage = () => {
|
||||
</form>
|
||||
|
||||
{/* Подсказка по тестовым логинам */}
|
||||
<div className="mt-4 text-[10px] text-white font-montserrat space-y-1">
|
||||
<div className="mt-4 text-[15px] text-white font-mонтserrat space-y-1">
|
||||
<p>Тестовые аккаунты:</p>
|
||||
<p>Пользователь: user@mail.com / user123</p>
|
||||
<p>Волонтёр: vol@mail.com / vol123</p>
|
||||
|
||||
Reference in New Issue
Block a user