diff --git a/frontend/src/components/mapMenu/MapMenu.tsx b/frontend/src/components/mapMenu/MapMenu.tsx
index 86c0662..8d3538f 100644
--- a/frontend/src/components/mapMenu/MapMenu.tsx
+++ b/frontend/src/components/mapMenu/MapMenu.tsx
@@ -5,9 +5,8 @@ import Coins from "./UIMapMenu/Coins.tsx";
import './../../styles/mapMenu.scss'
import ChooseModuleWindow from "./UIMapMenu/ChooseModuleWindow.tsx";
import UserProfile from "./UIMapMenu/UserProfile.tsx";
-import StarUnit from "./UIMapMenu/Level/StarUnit.tsx";
+import Module from "./UIMapMenu/Level/Module.tsx";
import mapMenuStore from "../../store/mapMenuStore.ts";
-import {ILevelType} from "../../types/LevelType.ts";
const MapMenu: React.FC = () => {
const navigate = useNavigate()
@@ -24,54 +23,6 @@ const MapMenu: React.FC = () => {
})
}, [navigate])
- // const onHandleSignOut = () => {
- // authStore.logOutUser().then()
- // navigate('/')
- // }
-
- const geolocations: ILevelType[] = [
- {
- id: "1",
- levels: {
- levelName: "Уровень 1",
- title: "Собери помидорки",
- menu: [{
- taskName: "test",
- body: "Какая-то информация которая очень хорошо тебе поведает тайну о помидорках и ещё какая-то информация которая очень хорошо тебе поведает тайну о помидорках ",
- }]
- }
- },
- {
- id: "2",
- level: {
- levelName: "Уровень 2",
- title: "Собери не помидорки",
- menu: [{
- taskName: "theory",
- body: "Я уже не помидорка"
- }]
- }
- },
- {
- id: "3",
- level: {
- levelName: "Уровень 3",
- title: "Начни текст",
- menu: [
- {
- taskName: "video",
- body: "Я помидорка"
- },
- {
- taskName: "test",
- body: "БУБУБУБУ"
- }
- ]
- }
- },
-
- ]
-
return (
@@ -81,10 +32,9 @@ const MapMenu: React.FC = () => {
{geolocations.map((geolocation) =>
- )}
+ )}
- {/*
*/}
);
};
diff --git a/frontend/src/components/mapMenu/UIMapMenu/Level/StarUnit.tsx b/frontend/src/components/mapMenu/UIMapMenu/Level/Module.tsx
similarity index 84%
rename from frontend/src/components/mapMenu/UIMapMenu/Level/StarUnit.tsx
rename to frontend/src/components/mapMenu/UIMapMenu/Level/Module.tsx
index 33f8d38..90853d7 100644
--- a/frontend/src/components/mapMenu/UIMapMenu/Level/StarUnit.tsx
+++ b/frontend/src/components/mapMenu/UIMapMenu/Level/Module.tsx
@@ -1,14 +1,14 @@
import React, {useState} from 'react';
import ModalWindow from "../../../../UIComponents/modalWindow/ModalWindow.tsx";
import ModalLevelBody from "./ModalLevelBody.tsx";
-import {LevelType} from "../../../../types/LevelType.ts";
+import {ILevelType} from "../../../../types/LevelType.ts";
interface IGeolocationProps {
id: number,
- level: LevelType
+ level: ILevelType
}
-const StarUnit: React.FC = ({id, level}) => {
+const Module: React.FC = ({id, level}) => {
const [isOpenModalWindow, setOpenModalWindow] = useState(false)
const classNameGeolocation = "geolocation-" + id
return (
@@ -17,8 +17,8 @@ const StarUnit: React.FC = ({id, level}) => {
{isOpenModalWindow
? setOpenModalWindow(!isOpenModalWindow)}
- body={}
+ body={}
/>
: ""}
@@ -45,4 +45,4 @@ const StarUnit: React.FC = ({id, level}) => {
};
-export default StarUnit;
+export default Module;
diff --git a/frontend/src/components/mapMenu/UIMapMenu/Level/modalLevelBody.css b/frontend/src/components/mapMenu/UIMapMenu/Level/modalLevelBody.css
deleted file mode 100644
index 8b52b30..0000000
--- a/frontend/src/components/mapMenu/UIMapMenu/Level/modalLevelBody.css
+++ /dev/null
@@ -1,68 +0,0 @@
-.header-modal {
- width: 100%;
- height: 5rem;
- border-radius: 15px;
- background: linear-gradient(to right, #7f1e8b, #8452ce);
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
-.menu {
- position: absolute;
- margin-left: 1.25rem;
- top: 23%;
- width: 8%;
- max-height: 75%;
- background: #763186;
- padding: 2px;
- border-radius: 30px;
-}
-
-.text-info {
- position: absolute;
- left: 12%;
- width: 76%;
- margin-top: 10px;
-}
-
-.level-title {
- color: #2B2A29;
- font-family: Golos, sans-serif;
- font-size: 1.75rem;
- font-style: normal;
- font-weight: 700;
- line-height: normal;
- letter-spacing: 0.125rem;
- text-align: left;
-}
-
-.level-name {
- color: #F5F5F5;
- text-align: center;
- font-family: Golos, sans-serif;
- font-size: 1.5rem;
- font-style: normal;
- font-weight: 700;
- line-height: normal;
- letter-spacing: 0.1125rem;
-}
-
-.level-body {
- color: #000;
- font-family: Golos, sans-serif;
- font-size: 1.125rem;
- font-style: normal;
- font-weight: 700;
- line-height: normal;
- letter-spacing: 0.1125rem;
- word-break: break-word;
- margin-top: 20px;
- text-align: left;
-}
-
-.menu-item {
- margin-top: 5px;
-}
-
-/*# sourceMappingURL=modalLevelBody.css.map */
diff --git a/frontend/src/components/mapMenu/UIMapMenu/Level/modalLevelBody.css.map b/frontend/src/components/mapMenu/UIMapMenu/Level/modalLevelBody.css.map
deleted file mode 100644
index 080f46f..0000000
--- a/frontend/src/components/mapMenu/UIMapMenu/Level/modalLevelBody.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sourceRoot":"","sources":["modalLevelBody.scss","../../../../styles/variablesStyles.scss"],"names":[],"mappings":"AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA,YCbY;EDcZ;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;;;AAGF;EACE","file":"modalLevelBody.css"}
\ No newline at end of file
diff --git a/frontend/src/store/mapMenuStore.ts b/frontend/src/store/mapMenuStore.ts
index 2d73419..f480f3d 100644
--- a/frontend/src/store/mapMenuStore.ts
+++ b/frontend/src/store/mapMenuStore.ts
@@ -1,10 +1,14 @@
import {makeAutoObservable} from "mobx";
import axios from "axios";
+import {IMapType} from "../types/MapType.ts";
import {IModuleType} from "../types/ModuleType.ts";
class MapMenuStore {
- mapMenu: IModuleType[] = []
- availableMaps: { id: string }[] = []
+ mapMenu: IMapType | null = null
+ availableMaps: IMapType[] = []
+
+ modulesMap: IModuleType | null = null
+ availableModules: IModuleType[] = []
constructor() {
makeAutoObservable(this)
@@ -18,9 +22,9 @@ class MapMenuStore {
await axios.get("http://localhost:8000/maps/" + id).then((response) => this.mapMenu = response.data)
}
- // setModulesMap(newModulesMap: IModuleType[]) {
- // this.modulesMap = newModulesMap
- // }
+ setModulesMap(newModulesMap: IModuleType) {
+ this.modulesMap = newModulesMap
+ }
// updateMapById(id: string) {
// axios.patch(id, {
diff --git a/frontend/src/types/LevelType.ts b/frontend/src/types/LevelType.ts
index 79f6f29..0361834 100644
--- a/frontend/src/types/LevelType.ts
+++ b/frontend/src/types/LevelType.ts
@@ -1,10 +1,6 @@
-import {ITaskType} from "./TaskType.ts";
-
export interface ILevelType {
id: string,
- levels: {
- levelName: string,
- title: string
- menu: ITaskType[]
- }[]
+ name: string,
+ body: string,
+ tasks: string[]
}
diff --git a/frontend/src/types/MapType.ts b/frontend/src/types/MapType.ts
index be2a2b5..a44ae29 100644
--- a/frontend/src/types/MapType.ts
+++ b/frontend/src/types/MapType.ts
@@ -1,7 +1,5 @@
-import {IModuleType} from "./ModuleType.ts";
-
export interface IMapType {
id: string,
title: string,
- modules_ids: IModuleType[]
+ modules_ids: string[]
}
diff --git a/frontend/src/types/ModuleType.ts b/frontend/src/types/ModuleType.ts
index 0d2a9c8..bd9c68d 100644
--- a/frontend/src/types/ModuleType.ts
+++ b/frontend/src/types/ModuleType.ts
@@ -1,8 +1,8 @@
-import {ILevelType} from "./LevelType.ts";
-
export interface IModuleType {
- mapId: string,
+ map_id: string,
title: string,
- moduleId: string,
- modules_ids: ILevelType[]
+ previous_module_id: string,
+ next_module_id: string,
+ id: string,
+ levels_ids: string[]
}
diff --git a/frontend/src/types/RouteType.ts b/frontend/src/types/RouteType.ts
index 1739f4a..190e02d 100644
--- a/frontend/src/types/RouteType.ts
+++ b/frontend/src/types/RouteType.ts
@@ -5,4 +5,3 @@ export interface IRouteType {
path: string,
element: ReactNode
}
-
diff --git a/frontend/src/types/TaskType.ts b/frontend/src/types/TaskType.ts
index 1dfb0a6..3f17243 100644
--- a/frontend/src/types/TaskType.ts
+++ b/frontend/src/types/TaskType.ts
@@ -1,4 +1,5 @@
export interface ITaskType {
- taskName: string,
+ id: string,
+ name: string,
body: string
}