Added quick map select with double click
This commit is contained in:
parent
5539fcf16a
commit
98798235c9
@ -7,7 +7,14 @@ import RemoveMapIcon from "../../icons/RemoveMapIcon";
|
|||||||
import ResetMapIcon from "../../icons/ResetMapIcon";
|
import ResetMapIcon from "../../icons/ResetMapIcon";
|
||||||
import ExpandMoreDotIcon from "../../icons/ExpandMoreDotIcon";
|
import ExpandMoreDotIcon from "../../icons/ExpandMoreDotIcon";
|
||||||
|
|
||||||
function MapTile({ map, isSelected, onMapSelect, onMapRemove, onMapReset }) {
|
function MapTile({
|
||||||
|
map,
|
||||||
|
isSelected,
|
||||||
|
onMapSelect,
|
||||||
|
onMapRemove,
|
||||||
|
onMapReset,
|
||||||
|
onSubmit,
|
||||||
|
}) {
|
||||||
const [isMapTileMenuOpen, setIsTileMenuOpen] = useState(false);
|
const [isMapTileMenuOpen, setIsTileMenuOpen] = useState(false);
|
||||||
const [hasMapState, setHasMapState] = useState(false);
|
const [hasMapState, setHasMapState] = useState(false);
|
||||||
|
|
||||||
@ -104,6 +111,12 @@ function MapTile({ map, isSelected, onMapSelect, onMapRemove, onMapReset }) {
|
|||||||
setIsTileMenuOpen(false);
|
setIsTileMenuOpen(false);
|
||||||
onMapSelect(map);
|
onMapSelect(map);
|
||||||
}}
|
}}
|
||||||
|
onDoubleClick={(e) => {
|
||||||
|
if (!isMapTileMenuOpen) {
|
||||||
|
onMapSelect(map);
|
||||||
|
onSubmit(e);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<UIImage
|
<UIImage
|
||||||
sx={{ width: "100%", height: "100%", objectFit: "contain" }}
|
sx={{ width: "100%", height: "100%", objectFit: "contain" }}
|
||||||
|
@ -12,6 +12,7 @@ function MapTiles({
|
|||||||
onMapAdd,
|
onMapAdd,
|
||||||
onMapRemove,
|
onMapRemove,
|
||||||
onMapReset,
|
onMapReset,
|
||||||
|
onSubmit,
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
@ -61,6 +62,7 @@ function MapTiles({
|
|||||||
onMapSelect={onMapSelect}
|
onMapSelect={onMapSelect}
|
||||||
onMapRemove={onMapRemove}
|
onMapRemove={onMapRemove}
|
||||||
onMapReset={onMapReset}
|
onMapReset={onMapReset}
|
||||||
|
onSubmit={onSubmit}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
@ -256,6 +256,7 @@ function SelectMapModal({
|
|||||||
selectedMap={selectedMap && selectedMap.id}
|
selectedMap={selectedMap && selectedMap.id}
|
||||||
onMapSelect={handleMapSelect}
|
onMapSelect={handleMapSelect}
|
||||||
onMapReset={handleMapReset}
|
onMapReset={handleMapReset}
|
||||||
|
onSubmit={handleSubmit}
|
||||||
/>
|
/>
|
||||||
<Flex>
|
<Flex>
|
||||||
<Box mb={2} mr={1} sx={{ flexGrow: 1 }}>
|
<Box mb={2} mr={1} sx={{ flexGrow: 1 }}>
|
||||||
|
Loading…
Reference in New Issue
Block a user