added submenu to settings
widget information is now stored in two arrays. One array (widgetArray) holds the id and name/type of the widget. The second array (layout) holds the id, position, width, height, and static info
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Global, css } from "@emotion/react";
|
||||
import Header from './Header/Header.jsx';
|
||||
import Sidebar from './Sidebar/Sidebar.jsx';
|
||||
import Canvas from './Canvas/Canvas.jsx';
|
||||
import { Grid, GridItem, useRecipe } from '@chakra-ui/react';
|
||||
import AlertLevel from './Canvas/components/AlertLevelWidget.jsx';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function Dashboard() {
|
||||
@@ -12,11 +12,7 @@ export default function Dashboard() {
|
||||
const [darkMode, setDarkMode] = useState(false);
|
||||
// Lifted State - defaults to widget dashboard
|
||||
const [view, setView] = useState("widget");
|
||||
const [layout, setLayout] = useState([
|
||||
{ i: '0', x: 0, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: true },
|
||||
{ i: '1', x: 3, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: true },
|
||||
{ i: '2', x: 6, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: true }
|
||||
]);
|
||||
const [layout, setLayout] = useState([]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -49,7 +45,7 @@ export default function Dashboard() {
|
||||
setLayout={ setLayout }
|
||||
onLayoutChange={( newLayout ) => setLayout( newLayout )}
|
||||
/>
|
||||
</GridItem>
|
||||
</GridItem>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user