Disable map interaction in map selection modal
This commit is contained in:
parent
a6768727fe
commit
9f21f895ba
@ -5,6 +5,7 @@ import SelectMapModal from "../../modals/SelectMapModal";
|
|||||||
import SelectMapIcon from "../../icons/SelectMapIcon";
|
import SelectMapIcon from "../../icons/SelectMapIcon";
|
||||||
|
|
||||||
import MapDataContext from "../../contexts/MapDataContext";
|
import MapDataContext from "../../contexts/MapDataContext";
|
||||||
|
import MapInteractionContext from "../../contexts/MapInteractionContext";
|
||||||
|
|
||||||
function SelectMapButton({
|
function SelectMapButton({
|
||||||
onMapChange,
|
onMapChange,
|
||||||
@ -14,13 +15,16 @@ function SelectMapButton({
|
|||||||
}) {
|
}) {
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
|
|
||||||
|
const { setPreventMapInteraction } = useContext(MapInteractionContext);
|
||||||
const { updateMapState } = useContext(MapDataContext);
|
const { updateMapState } = useContext(MapDataContext);
|
||||||
function openModal() {
|
function openModal() {
|
||||||
currentMapState && updateMapState(currentMapState.mapId, currentMapState);
|
currentMapState && updateMapState(currentMapState.mapId, currentMapState);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
|
setPreventMapInteraction(true);
|
||||||
}
|
}
|
||||||
function closeModal() {
|
function closeModal() {
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
|
setPreventMapInteraction(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDone() {
|
function handleDone() {
|
||||||
|
Loading…
Reference in New Issue
Block a user