From dd9a075c2071c1a87a175bf06070c438b2c9e3ad Mon Sep 17 00:00:00 2001 From: mihail323i21 Date: Thu, 16 Nov 2023 18:53:41 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B5=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE?= =?UTF-8?q?=D0=B7=D0=B8=D1=86=D0=B8=D1=80=D1=83=D0=B5=D1=82=20=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=D1=8B,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D1=81=D1=82=D0=B5=D0=B9=D1=82=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=B4=D0=B6=D0=B5=D1=80=20=D0=B4=D0=BB=D1=8F=20=D0=BA?= =?UTF-8?q?=D0=B0=D1=80=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/mapMenu/MapMenu.tsx | 3 ++- .../mapMenu/UIMapMenu/ChooseModuleWindow.tsx | 8 ------- .../mapMenu/UIMapMenu/Level/Geolocation.tsx | 9 +++----- .../UIMapMenu/Level/ModalLevelBody.tsx | 22 +++---------------- frontend/src/store/authStore.ts | 6 +++++ frontend/src/store/mapMenuStore.ts | 15 +++++++++++++ frontend/src/types/GeolocationType.ts | 6 +++++ frontend/src/types/LevelType.ts | 7 ++++++ frontend/src/types/TaskType.ts | 4 ++++ 9 files changed, 46 insertions(+), 34 deletions(-) create mode 100644 frontend/src/store/mapMenuStore.ts create mode 100644 frontend/src/types/GeolocationType.ts create mode 100644 frontend/src/types/LevelType.ts create mode 100644 frontend/src/types/TaskType.ts diff --git a/frontend/src/components/mapMenu/MapMenu.tsx b/frontend/src/components/mapMenu/MapMenu.tsx index 4798dd2..ce9a4a3 100644 --- a/frontend/src/components/mapMenu/MapMenu.tsx +++ b/frontend/src/components/mapMenu/MapMenu.tsx @@ -7,6 +7,7 @@ import './../../styles/mapMenu.scss' import ChooseModuleWindow from "./UIMapMenu/ChooseModuleWindow.tsx"; import UserProfile from "./UIMapMenu/UserProfile.tsx"; import Geolocation from "./UIMapMenu/Level/Geolocation.tsx"; +import {GeolocationType} from "../../types/GeolocationType.ts"; const MapMenu: React.FC = () => { const navigate = useNavigate() @@ -16,7 +17,7 @@ const MapMenu: React.FC = () => { navigate('/') } - const geolocations = [ + const geolocations: GeolocationType[] = [ { id: 1, level: { diff --git a/frontend/src/components/mapMenu/UIMapMenu/ChooseModuleWindow.tsx b/frontend/src/components/mapMenu/UIMapMenu/ChooseModuleWindow.tsx index ed03c42..633cf00 100644 --- a/frontend/src/components/mapMenu/UIMapMenu/ChooseModuleWindow.tsx +++ b/frontend/src/components/mapMenu/UIMapMenu/ChooseModuleWindow.tsx @@ -1,6 +1,4 @@ import React from 'react'; -import ArrowLeft from "./UIChooseModule/ArrowLeft.tsx"; -import ArrowRight from "./UIChooseModule/ArrowRight.tsx"; interface IPropTypes { @@ -10,13 +8,7 @@ const ChooseModuleWindow: React.FC = () => { return (
-
- -
МОДУЛЬ 1 -
- -
); diff --git a/frontend/src/components/mapMenu/UIMapMenu/Level/Geolocation.tsx b/frontend/src/components/mapMenu/UIMapMenu/Level/Geolocation.tsx index bf537c8..691c810 100644 --- a/frontend/src/components/mapMenu/UIMapMenu/Level/Geolocation.tsx +++ b/frontend/src/components/mapMenu/UIMapMenu/Level/Geolocation.tsx @@ -1,13 +1,10 @@ import React, {useState} from 'react'; import ModalWindow from "../../../../UIComponents/modalWindow/ModalWindow.tsx"; -import ModalLevelBody, {IModalLevelProps} from "./ModalLevelBody.tsx"; +import ModalLevelBody from "./ModalLevelBody.tsx"; +import {GeolocationType} from "../../../../types/GeolocationType.ts"; -interface IGeolocationProps { - id: number, - level: IModalLevelProps -} -const Geolocation: React.FC = ({id, level}) => { +const Geolocation: React.FC = ({id, level}) => { const [isOpenModalWindow, setOpenModalWindow] = useState(false) const classNameGeolocation = "geolocation-" + id return ( diff --git a/frontend/src/components/mapMenu/UIMapMenu/Level/ModalLevelBody.tsx b/frontend/src/components/mapMenu/UIMapMenu/Level/ModalLevelBody.tsx index 1cf98f4..964b5d0 100644 --- a/frontend/src/components/mapMenu/UIMapMenu/Level/ModalLevelBody.tsx +++ b/frontend/src/components/mapMenu/UIMapMenu/Level/ModalLevelBody.tsx @@ -2,26 +2,10 @@ import React, {useState} from 'react'; import "./modalLevelBody.scss" import ArrowLeft from "../UIChooseModule/ArrowLeft.tsx"; import ArrowRight from "../UIChooseModule/ArrowRight.tsx"; +import {LevelType} from "../../../../types/LevelType.ts"; -export interface IModalLevelProps { - levelName: string, - title: string, - menu: MenuType[] -} - -type MenuType = { - taskName: string, - body: string -} - -interface taskType { - name: string, - element: JSX.Element -} - - -const ModalLevelBody: React.FC = ({levelName, title, menu}) => { - const tasks: taskType[] = [ +const ModalLevelBody: React.FC = ({levelName, title, menu}) => { + const tasks = [ {name: "theory", element: }, {name: "video", element: