Skip to content

Commit

Permalink
menu UI mostly done
Browse files Browse the repository at this point in the history
  • Loading branch information
micheal-w-wells committed Oct 20, 2023
1 parent 744803e commit 0110cd9
Showing 1 changed file with 32 additions and 25 deletions.
57 changes: 32 additions & 25 deletions appv2/src/UI/Map/Buttons/CustomizeLayerDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ const CustomizeLayerMenu = (props) => {
setNewLayerName('');
};


const onKMLDone = () => {
cleanup();
dispatch({ type: TOGGLE_CUSTOMIZE_LAYERS })
}

dispatch({ type: TOGGLE_CUSTOMIZE_LAYERS });
};

return (
<Dialog open={dialogueOpen}>
Expand All @@ -102,9 +100,7 @@ const CustomizeLayerMenu = (props) => {
className={classes.select}
value={newLayerName}
onChange={(e) => setNewLayerName(e.target.value)}
label="Name your new layer">
</TextField>

label="Name your new layer"></TextField>
</FormControl>
),
Remove: (
Expand All @@ -123,9 +119,7 @@ const CustomizeLayerMenu = (props) => {
</Select>
</FormControl>
),
Upload: (
<KMLShapesUpload title={newLayerName} open={subMenuType === 'Upload'} whenDone={onKMLDone}/>
),
Upload: <KMLShapesUpload title={newLayerName} open={subMenuType === 'Upload'} whenDone={onKMLDone} />,
Init: <></>
}[subMenuType]
}
Expand All @@ -152,20 +146,35 @@ const CustomizeLayerMenu = (props) => {
),
New: (
<>
<Button onClick={() => {
setSubMenuType('Upload')
}}>Create</Button>
<Button onClick={() => {
cleanup()
}}>Back</Button>
<Button
onClick={() => {
if (optionVal === 'Upload KML/KMZ') {
setSubMenuType('Upload');
} else {
cleanup();
}
}}>
Create
</Button>
<Button
onClick={() => {
cleanup();
}}>
Back
</Button>
</>
),
Remove: (
<>
<Button disabled={layerToDelete === null} onClick={() => {}}>Remove</Button>
<Button onClick={() => {
cleanup()
}}>Back</Button>
<Button disabled={layerToDelete === null} onClick={() => {}}>
Remove
</Button>
<Button
onClick={() => {
cleanup();
}}>
Back
</Button>
</>
)
}[subMenuType]
Expand All @@ -174,14 +183,12 @@ const CustomizeLayerMenu = (props) => {
onClick={() => {
dispatch({ type: TOGGLE_CUSTOMIZE_LAYERS });
cleanup();
}}>Exit</Button>
}}>
Exit
</Button>
</DialogActions>
</Dialog>
);
};




export default CustomizeLayerMenu;

0 comments on commit 0110cd9

Please sign in to comment.