Skip to content

Commit

Permalink
fix: basemap modal closes menu (#938)
Browse files Browse the repository at this point in the history
* fix (bottomSheet): bottomSheet close on generate mbtiles click in mobile view

* fix (projectDetails): generateMbTilesModal - close modal when footer selection changes
  • Loading branch information
NSUWAL123 authored Oct 30, 2023
1 parent 31ae1fc commit b8a38b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -119,7 +120,10 @@ const ProjectOptions = ({ setToggleGenerateModal }) => {
</CoreModules.Button>
</CoreModules.Link>
<CoreModules.Button
onClick={() => setToggleGenerateModal(true)}
onClick={() => {
setToggleGenerateModal(true);
dispatch(ProjectActions.SetMobileFooterSelection('explore'));
}}
variant="contained"
color="error"
sx={{ width: '200px', mr: '15px' }}
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/views/NewProjectDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ const Home = () => {
fillOpacity: '0',
};

useEffect(() => {
if (mobileFooterSelection !== 'explore') {
setToggleGenerateModal(false);
}
}, [mobileFooterSelection]);

return (
<div>
{/* Customized Modal For Generate Tiles */}
Expand Down

0 comments on commit b8a38b7

Please sign in to comment.