Rename and Restructure

+ took out extra 'layout' directory.
+ 'Canvas' postfix removed from all files in the views directory.
+ "WidgetCanvas" renamed to "MyDashboard"
This commit is contained in:
2025-08-05 12:57:18 -07:00
parent 03a335710f
commit ff95f2cbc0
27 changed files with 20 additions and 20 deletions
@@ -0,0 +1,35 @@
import { IoIosArrowBack } from "react-icons/io";
import { Menu, Portal } from "@chakra-ui/react";
import { v4 as uuid } from 'uuid';
import AlertLevel from "./AlertLevelWidget";
export default function AddWidgetMenu({onAddWidget, widgetArray, setWidgetArray}) {
function appendWidget(name) {
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}
]);
onAddWidget(newID); // updating array containing info on layout of widgets
}
return (
<Menu.Root>
<Menu.TriggerItem>
<IoIosArrowBack /> Add Widget
</Menu.TriggerItem>
<Portal>
<Menu.Positioner>
<Menu.Content>
<Menu.Item
value="AlertLevel"
onClick={() => appendWidget(AlertLevel)}
>
Alert Level
</Menu.Item>
</Menu.Content>
</Menu.Positioner>
</Portal>
</Menu.Root>
)
}