удаляем тольео токен
This commit is contained in:
parent
cb05aa77dd
commit
6fbaf47905
@ -205,4 +205,23 @@ export const CourseExercises = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// type ButtonTheme = 'primary' | 'secondary' | 'contrast';
|
||||||
|
|
||||||
|
// interface ButtonProps {
|
||||||
|
// onClick: (event: MouseEvent) =>
|
||||||
|
// theme: ButtonTheme
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const Button = (props: ButtonProps) => {
|
||||||
|
// const {theme} = props;
|
||||||
|
// return <button className={theme === 'primary' ? 'bg-teal-500 text-black' : "ajksdf"}>кнопка</button>
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const Page = () => {
|
||||||
|
// const t: ButtonTheme = 'contrast'
|
||||||
|
// return (
|
||||||
|
// <div>
|
||||||
|
// <Button onClick={() => {}} theme={t}/>
|
||||||
|
// </div>
|
||||||
|
// )
|
||||||
|
// }
|
@ -76,7 +76,7 @@ export default function Home() {
|
|||||||
setCourses(allCourses)
|
setCourses(allCourses)
|
||||||
setError("")
|
setError("")
|
||||||
})
|
})
|
||||||
.catch((error: any) => {
|
.catch((error) => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
console.error("Ошибка ответа сервера:", error.response.status, error.response.data)
|
console.error("Ошибка ответа сервера:", error.response.status, error.response.data)
|
||||||
setError(`Ошибка сервера: ${error.response.status}`)
|
setError(`Ошибка сервера: ${error.response.status}`)
|
||||||
@ -93,7 +93,7 @@ export default function Home() {
|
|||||||
})
|
})
|
||||||
}, [token])
|
}, [token])
|
||||||
|
|
||||||
// Calculate statistics based on real data
|
// Расчет статистики / выполненные где брать???
|
||||||
const totalCourses = courses.length
|
const totalCourses = courses.length
|
||||||
const totalExercises = courses.reduce((sum, course) => {
|
const totalExercises = courses.reduce((sum, course) => {
|
||||||
if (course.course_exercises && Array.isArray(course.course_exercises)) {
|
if (course.course_exercises && Array.isArray(course.course_exercises)) {
|
||||||
@ -153,11 +153,11 @@ export default function Home() {
|
|||||||
<div className="flex flex-col gap-6">
|
<div className="flex flex-col gap-6">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="text-sm sm:text-base text-gray-800">Все курсы</div>
|
<div className="text-sm sm:text-base text-gray-800">Все курсы</div>
|
||||||
<div className="text-2xl font-bold text-cyan-500">{totalCourses}/1</div>
|
<div className="text-2xl font-bold text-cyan-500">{totalCourses}/?</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="text-sm sm:text-base text-gray-800">Все упражнения</div>
|
<div className="text-sm sm:text-base text-gray-800">Все упражнения</div>
|
||||||
<div className="text-2xl font-bold text-orange-400">{totalExercises}/4</div>
|
<div className="text-2xl font-bold text-orange-400">{totalExercises}/?</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-center items-center gap-8">
|
<div className="flex justify-center items-center gap-8">
|
||||||
|
@ -11,7 +11,7 @@ const Settings: React.FC = () => {
|
|||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
localStorage.clear()
|
localStorage.removeItem('token')
|
||||||
history.push(getRouteLogin())
|
history.push(getRouteLogin())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,12 +44,12 @@ const userEmail = localStorage.getItem('userEmail');
|
|||||||
<span className="text-gray-800">{userEmail}</span>
|
<span className="text-gray-800">{userEmail}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
{/* <div>
|
||||||
<label className="block text-sm font-medium text-gray-600 mb-1">Дата регистрации</label>
|
<label className="block text-sm font-medium text-gray-600 mb-1">Дата регистрации</label>
|
||||||
<div className="bg-gray-50 rounded-lg p-3 border border-gray-200">
|
<div className="bg-gray-50 rounded-lg p-3 border border-gray-200">
|
||||||
<span className="text-gray-800">Надо /не надо?</span>
|
<span className="text-gray-800">Надо /не надо?</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user