Dialog popup works

This commit is contained in:
2025-08-12 09:55:57 -07:00
parent f8c9a0cc0b
commit f85c64e7f0
2 changed files with 41 additions and 8 deletions
+8 -8
View File
@@ -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>
</>
);
}