From 68961f21f55f2b04564ef115ffc51c822533dbfb Mon Sep 17 00:00:00 2001 From: semantics Date: Thu, 14 Dec 2023 08:14:52 +0500 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BB=D0=B8?= =?UTF-8?q?=D1=88=D0=BD=D0=B5=D0=B5=20=D1=81=D0=BE=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=BA=D0=B0=D1=80=D1=82,=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D1=83=20=D0=BF=D0=BB=D1=8E=D1=81?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customAddButton/CustomAddButton.tsx | 16 ++++++--- .../mapMenu/SuperUserMap/SuperUserMap.tsx | 35 +++++++++++-------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/frontend/src/UIComponents/customAddButton/CustomAddButton.tsx b/frontend/src/UIComponents/customAddButton/CustomAddButton.tsx index e09687d..5ef8405 100644 --- a/frontend/src/UIComponents/customAddButton/CustomAddButton.tsx +++ b/frontend/src/UIComponents/customAddButton/CustomAddButton.tsx @@ -1,11 +1,17 @@ import React from 'react'; -const CustomAddButton: React.FC = () => { +interface ICustomAddButton { + handleOnClick: () => void; +} + +const CustomAddButton: React.FC = ({handleOnClick}) => { return ( - - - - +
+ + + + +
); }; diff --git a/frontend/src/components/mapMenu/SuperUserMap/SuperUserMap.tsx b/frontend/src/components/mapMenu/SuperUserMap/SuperUserMap.tsx index b61c9a6..61d142c 100644 --- a/frontend/src/components/mapMenu/SuperUserMap/SuperUserMap.tsx +++ b/frontend/src/components/mapMenu/SuperUserMap/SuperUserMap.tsx @@ -22,9 +22,9 @@ const SuperUserMap: React.FC = observer(() => { .then(() => moduleMenuStore.fetchModules())) }, []); - function handleOnClickOptionMap(map: IMapType, indexMap: number) { + const handleOnClickOptionMap = useCallback((map: IMapType, indexMap: number) => { mapMenuStore.selectMap(map).then(() => mapMenuStore.changeCurrentMapIndex(indexMap)) - } + }, []) const handleOnClickChangeIsModalOpen = useCallback(() => { setIsUserListModalOpen(!isUsersListModalOpen) @@ -39,7 +39,7 @@ const SuperUserMap: React.FC = observer(() => { body={} windowContentStyles="" /> - : "" + : null } @@ -55,18 +55,25 @@ const SuperUserMap: React.FC = observer(() => { handleOnChange={(e) => mapMenuStore.changeNewMapName(e)}/> - +
+ mapMenuStore.createMap(mapMenuStore.newNameMap)}/> + mapMenuStore.changeNewMapName(e)}/> +
- + {/**/} + + {/**/} ); });