Add first widget button with popup menu

This commit is contained in:
Daniel S. Hansen
2025-08-11 11:31:15 -07:00
parent f2fe8b5fb2
commit 28a59ab366
2 changed files with 65 additions and 27 deletions
@@ -25,13 +25,13 @@ export default function MyDashboard({layout, onLayoutChange, isEditable, isDelet
});
};
// Show large 'Add Widget' button when dashboard is empty
if ( !widgetArray.length ) {
return (
<Flex
key="first-widget"
align="center"
justify="center"
height="300px"
h="100%"
w="100%"
bg="gray.150"
borderRadius="md"
@@ -41,6 +41,7 @@ export default function MyDashboard({layout, onLayoutChange, isEditable, isDelet
);
}
// Show responsive grid of widgets
return (
<chakra.div width="100%">
<ResponsiveGridLayout
@@ -58,7 +59,6 @@ export default function MyDashboard({layout, onLayoutChange, isEditable, isDelet
position="relative"
resizeHandle={<CustomResizeHandle isVisable={isEditable} />}
>
{ merged.map((item) => {
const Widget = item.widget;
return (
@@ -68,8 +68,6 @@ export default function MyDashboard({layout, onLayoutChange, isEditable, isDelet
);
})
}
</ResponsiveGridLayout>
</chakra.div>
);