увеличила отступ от хедера
This commit is contained in:
parent
a5d1c80aaa
commit
8133a97fc7
@ -95,7 +95,7 @@ const course = {
|
||||
|
||||
|
||||
<div className="bg-gray-50 w-full h-full overflow-auto">
|
||||
<div className="my-32 min-h-screen max-w-4xl mx-auto">
|
||||
<div className="my-36 min-h-screen max-w-4xl mx-auto">
|
||||
<HeaderNav item={course.name} text={course.description} />
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ const Home: React.FC = () => {
|
||||
|
||||
|
||||
|
||||
<div className="my-32 min-h-screen max-w-4xl mx-auto">
|
||||
<div className="my-36 min-h-screen max-w-4xl mx-auto">
|
||||
<HeaderNav item='Курсы' text='все назначенные' />
|
||||
|
||||
{/* Analytics Cards */}
|
||||
|
@ -98,7 +98,7 @@ const Exercise: React.FC = () => {
|
||||
return (
|
||||
|
||||
<div className="bg-gray-50 w-full h-full overflow-auto">
|
||||
<div className="mt-32 mb-90 min-h-screen max-w-4xl mx-auto">
|
||||
<div className="mt-36 mb-90 min-h-screen max-w-4xl mx-auto">
|
||||
|
||||
<HeaderNav item='Надо разобраться?' text='упражнение' />
|
||||
|
||||
|
@ -64,7 +64,7 @@ export default function Home() {
|
||||
|
||||
|
||||
<div className="bg-gray-50 w-full h-full overflow-auto">
|
||||
<div className="my-32 min-h-screen max-w-4xl mx-auto">
|
||||
<div className="my-36 min-h-screen max-w-4xl mx-auto">
|
||||
|
||||
<HeaderNav item='Результаты' text='главная'/>
|
||||
|
||||
|
@ -1,14 +1,10 @@
|
||||
"use client"
|
||||
|
||||
import type React from "react"
|
||||
import { useState } from "react"
|
||||
import React, { useState } from "react"
|
||||
import { useHistory } from "react-router-dom"
|
||||
import manImage from "../assets/man.svg" // Reverted to original import
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
|
||||
|
||||
export default function LoginPage() {
|
||||
const history = useHistory()
|
||||
// Стейты для формы входа
|
||||
@ -18,7 +14,7 @@ export default function LoginPage() {
|
||||
const [rememberMe, setRememberMe] = useState(false)
|
||||
const [activeTab, setActiveTab] = useState<"login" | "register">("login")
|
||||
|
||||
//// Состояние и обработчики регистрационной формы
|
||||
// Состояние и обработчики регистрационной формы
|
||||
const [registerFormData, setRegisterFormData] = useState({
|
||||
email: "", // Removed firstName, lastName
|
||||
password: "",
|
||||
@ -28,24 +24,40 @@ export default function LoginPage() {
|
||||
const [showRegisterPassword, setShowRegisterPassword] = useState(false)
|
||||
const [showConfirmRegisterPassword, setShowConfirmRegisterPassword] = useState(false)
|
||||
|
||||
|
||||
// Обработчик входа
|
||||
const handleLogin = async (e: React.FormEvent) => {
|
||||
e.preventDefault()
|
||||
e.preventDefault();
|
||||
try {
|
||||
const response = await axios.post('http://localhost:8093/auth/api/login', {
|
||||
email,
|
||||
password,
|
||||
rememberMe,
|
||||
})
|
||||
console.log('Ответ сервера:', response.data)
|
||||
// например, сохранить токен или перейти
|
||||
history.push("/home")
|
||||
});
|
||||
if (response.status === 204) {
|
||||
// Успешный вход
|
||||
// Можно сохранить токен или выполнить другие действия
|
||||
history.push("/home");
|
||||
} else {
|
||||
// Обработка других статусов, если нужно
|
||||
console.log('Ответ:', response);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Ошибка при входе:', error)
|
||||
alert('Ошибка при входе')
|
||||
if (axios.isAxiosError(error)) {
|
||||
console.error('Ошибка при входе:', error.message);
|
||||
if (error.response) {
|
||||
console.error('Статус:', error.response.status);
|
||||
console.error('Данные ответа:', error.response.data);
|
||||
if (error.response.status === 400) {
|
||||
alert('Неверные данные для входа');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.error('Неожиданная ошибка:', error);
|
||||
}
|
||||
alert('Ошибка при входе');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Обработчик регистрации
|
||||
@ -81,10 +93,6 @@ const handleRegisterSubmit = async (e: React.FormEvent) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const handleRegisterInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setRegisterFormData({
|
||||
...registerFormData,
|
||||
@ -97,7 +105,6 @@ const handleRegisterSubmit = async (e: React.FormEvent) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-[#3ABBC7] to-[#0D212C] flex items-center justify-center p-4">
|
||||
<div className="bg-white h-[58%] w-full z-0 absolute bottom-0"></div>
|
||||
|
@ -10,6 +10,7 @@ const Settings: React.FC = () => {
|
||||
const handleLogout = () => {
|
||||
// Simulate logout
|
||||
history.push("/login")
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -29,7 +29,7 @@ const CourseComplete: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
router.push("/home", "forward")
|
||||
router.push("/login", "forward")
|
||||
}, 3500) // Задержка 3 секунды
|
||||
|
||||
return () => clearTimeout(timer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user