diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 965e9eb..33a61ad 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -47,7 +47,12 @@ const router = createBrowserRouter([ }, { path: "admin", - element: + element: , + children: [ + { + path: "*", + element: + }], }, { path: "skill-tree", diff --git a/frontend/src/components/pages/Main/Main.tsx b/frontend/src/components/pages/Main/Main.tsx index b4ad58a..0957f12 100644 --- a/frontend/src/components/pages/Main/Main.tsx +++ b/frontend/src/components/pages/Main/Main.tsx @@ -85,7 +85,7 @@ const Main = () => { ))}
diff --git a/frontend/src/components/pages/SkillTree/SkillTree.module.less b/frontend/src/components/pages/SkillTree/SkillTree.module.less index 5a6482a..63086a3 100644 --- a/frontend/src/components/pages/SkillTree/SkillTree.module.less +++ b/frontend/src/components/pages/SkillTree/SkillTree.module.less @@ -7,5 +7,9 @@ width: 50%; } .right{ + width: 50%; +} +.card{ + margin: 10px; } \ No newline at end of file diff --git a/frontend/src/components/pages/SkillTree/SkillTree.tsx b/frontend/src/components/pages/SkillTree/SkillTree.tsx index 3594f64..8153191 100644 --- a/frontend/src/components/pages/SkillTree/SkillTree.tsx +++ b/frontend/src/components/pages/SkillTree/SkillTree.tsx @@ -1,19 +1,48 @@ import { Input } from "../../ui/input"; -import VacancyCard from "../../entities/VacancyCard/VacancyCard"; import { Textarea } from "../../shared/ui/textarea"; import { Label } from "../../shared/ui/label"; import { Button } from "../../shared/ui/button"; + import less from "./SkillTree.module.less"; import { Switch } from "../../shared/ui/switch"; -import { addEvent } from "../../widgets/Header/AuthAPI"; import { Link } from "react-router-dom"; -import { ToastAction } from "../../shared/ui/toast" -import { useToast } from "../../shared/ui/use-toast" - +import { ToastAction } from "../../shared/ui/toast"; +import { useToast } from "../../shared/ui/use-toast"; import { buttonVariants } from "../../ui/button"; +import { addEvent, submitRegister } from "../../widgets/Header/AuthAPI"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "../../ui/card"; +import { TrashIcon } from "lucide-react"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "../../shared/ui/dialog"; +import { t } from "i18next"; +import { useEffect, useState } from "react"; +import { eventList } from "../AdminEventPage/AdminEventAPI"; const SkillTree = () => { - const { toast } = useToast() + const { toast } = useToast(); + const [events, setEvents] = useState([]); + + useEffect(() => { + eventList() + .then((data) => { + setEvents(data); + }) + .catch((error) => { + console.error("Возникла ошибка с получением:", error); + }); + }, []); return (
@@ -75,8 +104,32 @@ const SkillTree = () => {
- - + {events.map((event) => ( + +
+ +
+ {event.title} + + Дата начала: {event.start_date} + +
+ {false && ( + + )} +
+ +

{event.description}

+
+ +
+
+ ))}
); diff --git a/frontend/src/components/widgets/Header/AuthAPI.ts b/frontend/src/components/widgets/Header/AuthAPI.ts index 3b9ef9c..d27fcd9 100644 --- a/frontend/src/components/widgets/Header/AuthAPI.ts +++ b/frontend/src/components/widgets/Header/AuthAPI.ts @@ -90,6 +90,7 @@ export const addEvent = (e: FormEvent) => { console.log(response.status); if (response.ok) { console.log('Создан:', response.headers.get('Location')); + window.location.reload(); return response.json(); } else { return response.text().then(errorMessage => {