увеличила отступ от хедера
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="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} />
|
<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='все назначенные' />
|
<HeaderNav item='Курсы' text='все назначенные' />
|
||||||
|
|
||||||
{/* Analytics Cards */}
|
{/* Analytics Cards */}
|
||||||
|
@ -98,7 +98,7 @@ const Exercise: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
|
|
||||||
<div className="bg-gray-50 w-full h-full overflow-auto">
|
<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='упражнение' />
|
<HeaderNav item='Надо разобраться?' text='упражнение' />
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ export default function Home() {
|
|||||||
|
|
||||||
|
|
||||||
<div className="bg-gray-50 w-full h-full overflow-auto">
|
<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='главная'/>
|
<HeaderNav item='Результаты' text='главная'/>
|
||||||
|
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import type React from "react"
|
import React, { useState } from "react"
|
||||||
import { useState } from "react"
|
|
||||||
import { useHistory } from "react-router-dom"
|
import { useHistory } from "react-router-dom"
|
||||||
import manImage from "../assets/man.svg" // Reverted to original import
|
import manImage from "../assets/man.svg" // Reverted to original import
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
// Стейты для формы входа
|
// Стейты для формы входа
|
||||||
@ -18,7 +14,7 @@ export default function LoginPage() {
|
|||||||
const [rememberMe, setRememberMe] = useState(false)
|
const [rememberMe, setRememberMe] = useState(false)
|
||||||
const [activeTab, setActiveTab] = useState<"login" | "register">("login")
|
const [activeTab, setActiveTab] = useState<"login" | "register">("login")
|
||||||
|
|
||||||
//// Состояние и обработчики регистрационной формы
|
// Состояние и обработчики регистрационной формы
|
||||||
const [registerFormData, setRegisterFormData] = useState({
|
const [registerFormData, setRegisterFormData] = useState({
|
||||||
email: "", // Removed firstName, lastName
|
email: "", // Removed firstName, lastName
|
||||||
password: "",
|
password: "",
|
||||||
@ -28,24 +24,40 @@ export default function LoginPage() {
|
|||||||
const [showRegisterPassword, setShowRegisterPassword] = useState(false)
|
const [showRegisterPassword, setShowRegisterPassword] = useState(false)
|
||||||
const [showConfirmRegisterPassword, setShowConfirmRegisterPassword] = useState(false)
|
const [showConfirmRegisterPassword, setShowConfirmRegisterPassword] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
// Обработчик входа
|
// Обработчик входа
|
||||||
const handleLogin = async (e: React.FormEvent) => {
|
const handleLogin = async (e: React.FormEvent) => {
|
||||||
e.preventDefault()
|
e.preventDefault();
|
||||||
try {
|
try {
|
||||||
const response = await axios.post('http://localhost:8093/auth/api/login', {
|
const response = await axios.post('http://localhost:8093/auth/api/login', {
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
rememberMe,
|
rememberMe,
|
||||||
})
|
});
|
||||||
console.log('Ответ сервера:', response.data)
|
if (response.status === 204) {
|
||||||
// например, сохранить токен или перейти
|
// Успешный вход
|
||||||
history.push("/home")
|
// Можно сохранить токен или выполнить другие действия
|
||||||
|
history.push("/home");
|
||||||
|
} else {
|
||||||
|
// Обработка других статусов, если нужно
|
||||||
|
console.log('Ответ:', response);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Ошибка при входе:', error)
|
if (axios.isAxiosError(error)) {
|
||||||
alert('Ошибка при входе')
|
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,17 +93,12 @@ const handleRegisterSubmit = async (e: React.FormEvent) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleRegisterInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleRegisterInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
||||||
setRegisterFormData({
|
setRegisterFormData({
|
||||||
...registerFormData,
|
...registerFormData,
|
||||||
[e.target.name]: e.target.value,
|
[e.target.name]: e.target.value,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ const Settings: React.FC = () => {
|
|||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
// Simulate logout
|
// Simulate logout
|
||||||
history.push("/login")
|
history.push("/login")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -29,7 +30,7 @@ const Settings: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className=" max-w-4xl mx-auto">
|
<div className="max-w-4xl mx-auto">
|
||||||
{/* Profile Information */}
|
{/* Profile Information */}
|
||||||
<div className="px-4 -mt-6 mb-6 ">
|
<div className="px-4 -mt-6 mb-6 ">
|
||||||
<div className="bg-white/80 backdrop-blur-lg rounded-2xl p-6 border border-gray-200/50 shadow-lg glass-morphism">
|
<div className="bg-white/80 backdrop-blur-lg rounded-2xl p-6 border border-gray-200/50 shadow-lg glass-morphism">
|
||||||
|
@ -29,7 +29,7 @@ const CourseComplete: React.FC = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
router.push("/home", "forward")
|
router.push("/login", "forward")
|
||||||
}, 3500) // Задержка 3 секунды
|
}, 3500) // Задержка 3 секунды
|
||||||
|
|
||||||
return () => clearTimeout(timer)
|
return () => clearTimeout(timer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user