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 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 [hasMapState, setHasMapState] = useState(false);
|
||||
|
||||
@ -104,6 +111,12 @@ function MapTile({ map, isSelected, onMapSelect, onMapRemove, onMapReset }) {
|
||||
setIsTileMenuOpen(false);
|
||||
onMapSelect(map);
|
||||
}}
|
||||
onDoubleClick={(e) => {
|
||||
if (!isMapTileMenuOpen) {
|
||||
onMapSelect(map);
|
||||
onSubmit(e);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<UIImage
|
||||
sx={{ width: "100%", height: "100%", objectFit: "contain" }}
|
||||
|
@ -12,6 +12,7 @@ function MapTiles({
|
||||
onMapAdd,
|
||||
onMapRemove,
|
||||
onMapReset,
|
||||
onSubmit,
|
||||
}) {
|
||||
return (
|
||||
<Flex
|
||||
@ -61,6 +62,7 @@ function MapTiles({
|
||||
onMapSelect={onMapSelect}
|
||||
onMapRemove={onMapRemove}
|
||||
onMapReset={onMapReset}
|
||||
onSubmit={onSubmit}
|
||||
/>
|
||||
))}
|
||||
</Flex>
|
||||
|
@ -256,6 +256,7 @@ function SelectMapModal({
|
||||
selectedMap={selectedMap && selectedMap.id}
|
||||
onMapSelect={handleMapSelect}
|
||||
onMapReset={handleMapReset}
|
||||
onSubmit={handleSubmit}
|
||||
/>
|
||||
<Flex>
|
||||
<Box mb={2} mr={1} sx={{ flexGrow: 1 }}>
|
||||
|
Loading…
Reference in New Issue
Block a user