From b8a38b799d8460d1bfa8534519001f20a3231d51 Mon Sep 17 00:00:00 2001 From: Nishit Suwal <81785002+NSUWAL123@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:34:41 +0545 Subject: [PATCH] fix: basemap modal closes menu (#938) * fix (bottomSheet): bottomSheet close on generate mbtiles click in mobile view * fix (projectDetails): generateMbTilesModal - close modal when footer selection changes --- .../src/components/ProjectDetails/ProjectOptions.tsx | 6 +++++- src/frontend/src/views/NewProjectDetails.jsx | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx b/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx index d5c5d546a1..77560b1e90 100644 --- a/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx +++ b/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx @@ -3,6 +3,7 @@ import CoreModules from '../../shared/CoreModules'; import AssetModules from '../../shared/AssetModules'; import environment from '../../environment'; import { DownloadDataExtract, DownloadProjectForm } from '../../api/Project'; +import { ProjectActions } from '../../store/slices/ProjectSlice'; const ProjectOptions = ({ setToggleGenerateModal }) => { const dispatch = CoreModules.useAppDispatch(); @@ -119,7 +120,10 @@ const ProjectOptions = ({ setToggleGenerateModal }) => { setToggleGenerateModal(true)} + onClick={() => { + setToggleGenerateModal(true); + dispatch(ProjectActions.SetMobileFooterSelection('explore')); + }} variant="contained" color="error" sx={{ width: '200px', mr: '15px' }} diff --git a/src/frontend/src/views/NewProjectDetails.jsx b/src/frontend/src/views/NewProjectDetails.jsx index a3cb8af42e..35721a72d8 100644 --- a/src/frontend/src/views/NewProjectDetails.jsx +++ b/src/frontend/src/views/NewProjectDetails.jsx @@ -186,6 +186,12 @@ const Home = () => { fillOpacity: '0', }; + useEffect(() => { + if (mobileFooterSelection !== 'explore') { + setToggleGenerateModal(false); + } + }, [mobileFooterSelection]); + return (
{/* Customized Modal For Generate Tiles */}