Dialog popup works
This commit is contained in:
@@ -34,15 +34,12 @@ export default function Dashboard() {
|
||||
|
||||
// Prevent navigation while in Edit mode without saving or cancelling
|
||||
const handleViewChange = (nextView) => {
|
||||
console.log("1. handling view change")
|
||||
if (view === "mydashboard" && isEditable) {
|
||||
dialog.open();
|
||||
<DialogPopup dialog={dialog}/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
console.log("2. currently editing");
|
||||
dialog.setOpen(true);
|
||||
return;
|
||||
|
||||
// const confirmed = window.confirm(
|
||||
// "You have unsaved changes. Discard them and continue?"
|
||||
// );
|
||||
@@ -62,6 +59,8 @@ export default function Dashboard() {
|
||||
const headerProps = { onChangeView: handleViewChange };
|
||||
|
||||
return (
|
||||
<>
|
||||
<DialogPopup dialog={dialog} />
|
||||
<Grid css={styles}
|
||||
templateRows="1fr 11fr"
|
||||
// templateColumns="1fr 20fr"
|
||||
@@ -79,5 +78,6 @@ export default function Dashboard() {
|
||||
<Canvas {...canvasProps}/>
|
||||
</GridItem>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user