Removed show more button for editing maps

This commit is contained in:
Mitchell McCaffrey 2020-10-22 16:39:24 +11:00
parent c60d495a14
commit 611e7af3d9
2 changed files with 90 additions and 126 deletions

View File

@ -21,8 +21,6 @@ function MapSettings({
mapState,
onSettingsChange,
onStateSettingsChange,
showMore,
onShowMoreChange,
}) {
function handleFlagChange(event, flag) {
if (event.target.checked) {
@ -131,8 +129,6 @@ function MapSettings({
my={1}
/>
</Box>
{showMore && (
<>
<Flex
mt={2}
mb={mapEmpty || map.type === "default" ? 2 : 0}
@ -156,9 +152,7 @@ function MapSettings({
<Checkbox
checked={!mapEmpty && map.showGrid}
disabled={mapEmpty || map.type === "default"}
onChange={(e) =>
onSettingsChange("showGrid", e.target.checked)
}
onChange={(e) => onSettingsChange("showGrid", e.target.checked)}
/>
Show Grid
</Label>
@ -166,9 +160,7 @@ function MapSettings({
<Checkbox
checked={!mapEmpty && map.snapToGrid}
disabled={mapEmpty || map.type === "default"}
onChange={(e) =>
onSettingsChange("snapToGrid", e.target.checked)
}
onChange={(e) => onSettingsChange("snapToGrid", e.target.checked)}
/>
Snap to Grid
</Label>
@ -185,13 +177,10 @@ function MapSettings({
qualitySettings.find((s) => s.value === map.quality)
}
isDisabled={mapEmpty}
onChange={(option) =>
onSettingsChange("quality", option.value)
}
onChange={(option) => onSettingsChange("quality", option.value)}
isOptionDisabled={(option) =>
mapEmpty ||
(option.value !== "original" &&
!map.resolutions[option.value])
(option.value !== "original" && !map.resolutions[option.value])
}
isSearchable={false}
/>
@ -215,9 +204,7 @@ function MapSettings({
</Label>
<Label>
<Checkbox
checked={
!mapStateEmpty && mapState.editFlags.includes("drawing")
}
checked={!mapStateEmpty && mapState.editFlags.includes("drawing")}
disabled={mapStateEmpty}
onChange={(e) => handleFlagChange(e, "drawing")}
/>
@ -225,9 +212,7 @@ function MapSettings({
</Label>
<Label>
<Checkbox
checked={
!mapStateEmpty && mapState.editFlags.includes("tokens")
}
checked={!mapStateEmpty && mapState.editFlags.includes("tokens")}
disabled={mapStateEmpty}
onChange={(e) => handleFlagChange(e, "tokens")}
/>
@ -235,23 +220,6 @@ function MapSettings({
</Label>
</Flex>
</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>
);
}

View File

@ -96,8 +96,6 @@ function EditMapModal({ isOpen, onDone, map, mapState }) {
...mapStateSettingChanges,
};
const [showMoreSettings, setShowMoreSettings] = useState(false);
return (
<Modal
isOpen={isOpen}
@ -121,8 +119,6 @@ function EditMapModal({ isOpen, onDone, map, mapState }) {
mapState={selectedMapStateWithChanges}
onSettingsChange={handleMapSettingsChange}
onStateSettingsChange={handleMapStateSettingsChange}
showMore={showMoreSettings}
onShowMoreChange={setShowMoreSettings}
/>
<Button onClick={handleSave}>Save</Button>
</Flex>