Make tile groups selectable

This commit is contained in:
Mitchell McCaffrey
2021-05-20 12:22:07 +10:00
parent 05968c1964
commit ef73ca0179
10 changed files with 223 additions and 148 deletions

View File

@@ -5,16 +5,19 @@ import Modal from "../components/Modal";
import MapSettings from "../components/map/MapSettings";
import MapEditor from "../components/map/MapEditor";
import { useMapData } from "../contexts/MapDataContext";
import { isEmpty } from "../helpers/shared";
import { getGridDefaultInset } from "../helpers/grid";
import useResponsiveLayout from "../hooks/useResponsiveLayout";
function EditMapModal({ isOpen, onDone, map, mapState }) {
const { updateMap, updateMapState } = useMapData();
function EditMapModal({
isOpen,
onDone,
map,
mapState,
onUpdateMap,
onUpdateMapState,
}) {
function handleClose() {
setMapSettingChanges({});
setMapStateSettingChanges({});
@@ -79,8 +82,8 @@ function EditMapModal({ isOpen, onDone, map, mapState }) {
}
}
}
await updateMap(map.id, mapSettingChanges);
await updateMapState(map.id, mapStateSettingChanges);
await onUpdateMap(map.id, mapSettingChanges);
await onUpdateMapState(map.id, mapStateSettingChanges);
setMapSettingChanges({});
setMapStateSettingChanges({});