Adding dialogs instead of window messages
This commit is contained in:
@@ -10,7 +10,7 @@ export default function WidgetMenu({appendWidget, triggerItem, positioning}) {
|
||||
<Menu.Content>
|
||||
<Menu.Item
|
||||
value="AlertLevel"
|
||||
onClick={() => appendWidget(AlertLevel, 4, 7, 4, 7, 4, 7)} // width and height are passed through here for each widget
|
||||
onClick={() => appendWidget(AlertLevel, 4, 7, 4, 7, 8, 14)} // width and height are passed through here for each widget
|
||||
>
|
||||
Alert Level
|
||||
</Menu.Item>
|
||||
|
||||
@@ -33,14 +33,14 @@ export default function Home({...props}) {
|
||||
resizeHandles: ['se']
|
||||
}
|
||||
]);
|
||||
onEditWidgets();
|
||||
// onEditWidgets();
|
||||
};
|
||||
|
||||
function appendWidget(name, w, h, minw, minh, maxw, maxh) {
|
||||
const newID = uuid(); // could be replaced with something else like guid
|
||||
setWidgetArray([ // updating widget array containing info on the types of widgets
|
||||
...widgetArray,
|
||||
{i: newID, widget: name }
|
||||
{i: newID, widget: name, resizable: true }
|
||||
]);
|
||||
onAddWidget(newID, w, h, minw, minh, maxw, maxh); // updating array containing info on layout of widgets
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user