Removed show more button for editing maps
This commit is contained in:
parent
c60d495a14
commit
611e7af3d9
@ -21,8 +21,6 @@ function MapSettings({
|
|||||||
mapState,
|
mapState,
|
||||||
onSettingsChange,
|
onSettingsChange,
|
||||||
onStateSettingsChange,
|
onStateSettingsChange,
|
||||||
showMore,
|
|
||||||
onShowMoreChange,
|
|
||||||
}) {
|
}) {
|
||||||
function handleFlagChange(event, flag) {
|
function handleFlagChange(event, flag) {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
@ -131,8 +129,6 @@ function MapSettings({
|
|||||||
my={1}
|
my={1}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
{showMore && (
|
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
mt={2}
|
mt={2}
|
||||||
mb={mapEmpty || map.type === "default" ? 2 : 0}
|
mb={mapEmpty || map.type === "default" ? 2 : 0}
|
||||||
@ -156,9 +152,7 @@ function MapSettings({
|
|||||||
<Checkbox
|
<Checkbox
|
||||||
checked={!mapEmpty && map.showGrid}
|
checked={!mapEmpty && map.showGrid}
|
||||||
disabled={mapEmpty || map.type === "default"}
|
disabled={mapEmpty || map.type === "default"}
|
||||||
onChange={(e) =>
|
onChange={(e) => onSettingsChange("showGrid", e.target.checked)}
|
||||||
onSettingsChange("showGrid", e.target.checked)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
Show Grid
|
Show Grid
|
||||||
</Label>
|
</Label>
|
||||||
@ -166,9 +160,7 @@ function MapSettings({
|
|||||||
<Checkbox
|
<Checkbox
|
||||||
checked={!mapEmpty && map.snapToGrid}
|
checked={!mapEmpty && map.snapToGrid}
|
||||||
disabled={mapEmpty || map.type === "default"}
|
disabled={mapEmpty || map.type === "default"}
|
||||||
onChange={(e) =>
|
onChange={(e) => onSettingsChange("snapToGrid", e.target.checked)}
|
||||||
onSettingsChange("snapToGrid", e.target.checked)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
Snap to Grid
|
Snap to Grid
|
||||||
</Label>
|
</Label>
|
||||||
@ -185,13 +177,10 @@ function MapSettings({
|
|||||||
qualitySettings.find((s) => s.value === map.quality)
|
qualitySettings.find((s) => s.value === map.quality)
|
||||||
}
|
}
|
||||||
isDisabled={mapEmpty}
|
isDisabled={mapEmpty}
|
||||||
onChange={(option) =>
|
onChange={(option) => onSettingsChange("quality", option.value)}
|
||||||
onSettingsChange("quality", option.value)
|
|
||||||
}
|
|
||||||
isOptionDisabled={(option) =>
|
isOptionDisabled={(option) =>
|
||||||
mapEmpty ||
|
mapEmpty ||
|
||||||
(option.value !== "original" &&
|
(option.value !== "original" && !map.resolutions[option.value])
|
||||||
!map.resolutions[option.value])
|
|
||||||
}
|
}
|
||||||
isSearchable={false}
|
isSearchable={false}
|
||||||
/>
|
/>
|
||||||
@ -215,9 +204,7 @@ function MapSettings({
|
|||||||
</Label>
|
</Label>
|
||||||
<Label>
|
<Label>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={
|
checked={!mapStateEmpty && mapState.editFlags.includes("drawing")}
|
||||||
!mapStateEmpty && mapState.editFlags.includes("drawing")
|
|
||||||
}
|
|
||||||
disabled={mapStateEmpty}
|
disabled={mapStateEmpty}
|
||||||
onChange={(e) => handleFlagChange(e, "drawing")}
|
onChange={(e) => handleFlagChange(e, "drawing")}
|
||||||
/>
|
/>
|
||||||
@ -225,9 +212,7 @@ function MapSettings({
|
|||||||
</Label>
|
</Label>
|
||||||
<Label>
|
<Label>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={
|
checked={!mapStateEmpty && mapState.editFlags.includes("tokens")}
|
||||||
!mapStateEmpty && mapState.editFlags.includes("tokens")
|
|
||||||
}
|
|
||||||
disabled={mapStateEmpty}
|
disabled={mapStateEmpty}
|
||||||
onChange={(e) => handleFlagChange(e, "tokens")}
|
onChange={(e) => handleFlagChange(e, "tokens")}
|
||||||
/>
|
/>
|
||||||
@ -235,23 +220,6 @@ function MapSettings({
|
|||||||
</Label>
|
</Label>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<IconButton
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
onShowMoreChange(!showMore);
|
|
||||||
}}
|
|
||||||
sx={{
|
|
||||||
transform: `rotate(${showMore ? "180deg" : "0"})`,
|
|
||||||
alignSelf: "center",
|
|
||||||
}}
|
|
||||||
aria-label={showMore ? "Show Less" : "Show More"}
|
|
||||||
title={showMore ? "Show Less" : "Show More"}
|
|
||||||
>
|
|
||||||
<ExpandMoreIcon />
|
|
||||||
</IconButton>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -96,8 +96,6 @@ function EditMapModal({ isOpen, onDone, map, mapState }) {
|
|||||||
...mapStateSettingChanges,
|
...mapStateSettingChanges,
|
||||||
};
|
};
|
||||||
|
|
||||||
const [showMoreSettings, setShowMoreSettings] = useState(false);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
@ -121,8 +119,6 @@ function EditMapModal({ isOpen, onDone, map, mapState }) {
|
|||||||
mapState={selectedMapStateWithChanges}
|
mapState={selectedMapStateWithChanges}
|
||||||
onSettingsChange={handleMapSettingsChange}
|
onSettingsChange={handleMapSettingsChange}
|
||||||
onStateSettingsChange={handleMapStateSettingsChange}
|
onStateSettingsChange={handleMapStateSettingsChange}
|
||||||
showMore={showMoreSettings}
|
|
||||||
onShowMoreChange={setShowMoreSettings}
|
|
||||||
/>
|
/>
|
||||||
<Button onClick={handleSave}>Save</Button>
|
<Button onClick={handleSave}>Save</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user