diff --git a/client/src/components/layout/Canvas/Canvas.jsx b/client/src/components/layout/Canvas/Canvas.jsx
index f4242f4..96e61d2 100644
--- a/client/src/components/layout/Canvas/Canvas.jsx
+++ b/client/src/components/layout/Canvas/Canvas.jsx
@@ -3,64 +3,20 @@
// of 'WidgetCanvas'
import { Box } from "@chakra-ui/react";
-import { useState } from 'react';
-import CanvasHeader from "./CanvasHeader";
-import WidgetCanvas from "./views/WidgetCanvas";
import GlobalMapCanvas from "./views/GlobalMapCanvas";
import RegionalMapCanvas from "./views/RegionalMapCanvas";
import VolcanoCanvas from "./views/VolcanoCanvas";
import AdminCanvas from "./views/AdminCanvas";
+import { DashboardCanvas } from "./views/DashboardCanvas";
export default function Canvas({ view }) {
- const [layout, setLayout] = useState([
- { i: '0', x: 0, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false },
- { i: '1', x: 3, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false },
- { i: '2', x: 6, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false }
- ]);
- const [newCounter, setNewCounter] = useState(3);
-
- const addWidget = () => {
- const newId = newCounter.toString();
- setLayout(prev => [
- ...prev,
- {
- i: newId,
- x: (prev.length * 3) % 12,
- y: Infinity,
- w: 3,
- h: 3
- }
- ]);
- setNewCounter(prev => prev + 1);
- };
-
- const removeWidget = (id) => {
- setLayout(prev => prev.filter(w => w.i !== id));
- }
-
- const onLayoutChange = (newLayout) => {
- setLayout(newLayout);
- console.log('Updated layout:', newLayout)
- };
-
return (
- console.log('Edit Widgets')}
- onDeleteWidgets={() => console.log('Delete Widgets')}
- />
- {view === "widget" &&
- }
+ {view === "widget" && }
{view === "global" && }
{view === "regional" && }
{view === "volcano" && }
{view === "admin" && }
);
-}
-
+}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/CanvasHeader.jsx b/client/src/components/layout/Canvas/CanvasHeader.jsx
deleted file mode 100644
index d387d30..0000000
--- a/client/src/components/layout/Canvas/CanvasHeader.jsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Flex, HStack, chakra, useRecipe } from "@chakra-ui/react";
-import { CanvasHeaderNav } from "./CanvasHeaderNav";
-import { SearchBar } from "./SearchBar";
-import { SettingsButton } from "./SettingsButton";
-
-export default function CanvasHeader({ onAddWidget, onEditWidgets, onDeleteWidgets }) {
- const recipe = useRecipe({ key: "canvas" });
- const styles = recipe();
- return (
-
-
-
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/CanvasHeaderNav.jsx b/client/src/components/layout/Canvas/CanvasHeaderNav.jsx
deleted file mode 100644
index b80d7c5..0000000
--- a/client/src/components/layout/Canvas/CanvasHeaderNav.jsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { HStack, Link } from "@chakra-ui/react"
-
-const navItems = [
- { label: "My Dashboard", href: "#dashboard" },
- { label: "Gas", href: "#gas" },
- { label: "Seismic", href: "#seismic" },
- { label: "Remote Sensing", href: "#remote" },
- { label: "Daily Activity", href: "#daily" },
-];
-
-export function CanvasHeaderNav() {
- return (
-
- {navItems.map(({ label, href }) => (
-
- {label}
-
- ))}
-
- );
-}
-
diff --git a/client/src/components/layout/Canvas/SearchBar.jsx b/client/src/components/layout/Canvas/components/SearchBar.jsx
similarity index 100%
rename from client/src/components/layout/Canvas/SearchBar.jsx
rename to client/src/components/layout/Canvas/components/SearchBar.jsx
diff --git a/client/src/components/layout/Canvas/SettingsButton.jsx b/client/src/components/layout/Canvas/components/SettingsButton.jsx
similarity index 57%
rename from client/src/components/layout/Canvas/SettingsButton.jsx
rename to client/src/components/layout/Canvas/components/SettingsButton.jsx
index 40d91b4..ee080ff 100644
--- a/client/src/components/layout/Canvas/SettingsButton.jsx
+++ b/client/src/components/layout/Canvas/components/SettingsButton.jsx
@@ -5,22 +5,7 @@
import { Button, IconButton, Menu, Portal } from "@chakra-ui/react";
import { FiSettings } from "react-icons/fi";
-export function SettingsButton({ onAddWidget, onEditWidgets, onDeleteWidgets }) {
- // const handleAddWidget = () => {
- // console.log("Add Widget clicked");
- // // TODO: Implement widget-adding logic
- // }
-
- // const handleEditWidgdets = () => {
- // console.log("Edit Widgets clicked")
- // // TODO: Implement widget-editing logic
- // }
-
- // const handleDeleteWidgets = () => {
- // console.log("Delete Widgets clicked");
- // // TODO: Implement widget-deletion logic
- // }
-
+export function SettingsButton({onAddWidget, onEditWidgdets, onRemoveWidgets}) {
return (
// This uses Chakra's built in menu component
@@ -32,10 +17,10 @@ export function SettingsButton({ onAddWidget, onEditWidgets, onDeleteWidgets })
- Add Widget
- Edit Widgets
+ Add Widget
+ Edit Widgets
diff --git a/client/src/components/layout/Canvas/Widget.jsx b/client/src/components/layout/Canvas/components/Widget.jsx
similarity index 100%
rename from client/src/components/layout/Canvas/Widget.jsx
rename to client/src/components/layout/Canvas/components/Widget.jsx
diff --git a/client/src/components/layout/Canvas/views/AdminCanvas.jsx b/client/src/components/layout/Canvas/views/AdminCanvas.jsx
index 5cbb749..51a85c4 100644
--- a/client/src/components/layout/Canvas/views/AdminCanvas.jsx
+++ b/client/src/components/layout/Canvas/views/AdminCanvas.jsx
@@ -1,24 +1,24 @@
import { Box, Text } from '@chakra-ui/react';
export default function AdminCanvas() {
- return (
-
-
-
- Admin Canvas coming soon!
-
-
-
- );
+ return (
+
+
+
+ Admin Canvas coming soon!
+
+
+
+ );
}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/views/DashboardCanvas.jsx b/client/src/components/layout/Canvas/views/DashboardCanvas.jsx
new file mode 100644
index 0000000..a297ba5
--- /dev/null
+++ b/client/src/components/layout/Canvas/views/DashboardCanvas.jsx
@@ -0,0 +1,106 @@
+import { HStack, Flex, Tabs } from "@chakra-ui/react";
+import WidgetCanvas from "./DashboardCanvasNav/WidgetCanvas";
+import { SearchBar } from "../components/SearchBar";
+import { SettingsButton } from "../components/SettingsButton";
+import { DailyActivity } from "./DashboardCanvasNav/DailyActivity";
+import { Gas } from "./DashboardCanvasNav/Gas";
+import { Seismic } from "./DashboardCanvasNav/Seismic";
+import { RemoteSensing } from "./DashboardCanvasNav/RemoteSensing";
+import { useState } from "react";
+
+export function DashboardCanvas() {
+ const [layout, setLayout] = useState([
+ { i: '0', x: 0, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false },
+ { i: '1', x: 3, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false },
+ { i: '2', x: 6, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false }
+ ]);
+
+ const [newCounter, setNewCounter] = useState(3);
+
+ const onAddWidget = () => {
+ const newId = newCounter.toString();
+ setLayout(prev => [
+ ...prev,
+ {
+ i: newId,
+ x: (prev.length * 3) % 12,
+ y: Infinity,
+ w: 3,
+ h: 3
+ }
+ ]);
+ setNewCounter(prev => prev + 1);
+ };
+
+ const onRemoveWidget = (id) => {
+ setLayout(prev => prev.filter(w => w.i !== id));
+ }
+
+ const onLayoutChange = (newLayout) => {
+ setLayout(newLayout);
+ console.log('Updated layout:', newLayout)
+ };
+
+ return (
+ /* HEADER */
+
+
+
+
+ My Dashboard
+
+
+ Gas
+
+
+ Seismic
+
+
+ Remote Sensing
+
+
+ Daily Activity
+
+
+
+
+
+
+
+
+
+ {/* CANVAS */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/views/DashboardCanvasNav/DailyActivity.jsx b/client/src/components/layout/Canvas/views/DashboardCanvasNav/DailyActivity.jsx
new file mode 100644
index 0000000..888ff00
--- /dev/null
+++ b/client/src/components/layout/Canvas/views/DashboardCanvasNav/DailyActivity.jsx
@@ -0,0 +1,22 @@
+import { Box, Text } from "@chakra-ui/react";
+
+export function DailyActivity() {
+ return(
+
+
+ Daily Activity dashboard coming soon.
+
+
+ );
+}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/views/DashboardCanvasNav/Gas.jsx b/client/src/components/layout/Canvas/views/DashboardCanvasNav/Gas.jsx
new file mode 100644
index 0000000..7589d69
--- /dev/null
+++ b/client/src/components/layout/Canvas/views/DashboardCanvasNav/Gas.jsx
@@ -0,0 +1,22 @@
+import { Box, Text } from "@chakra-ui/react";
+
+export function Gas() {
+ return(
+
+
+ Gas dashboard coming soon.
+
+
+ );
+}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/views/DashboardCanvasNav/RemoteSensing.jsx b/client/src/components/layout/Canvas/views/DashboardCanvasNav/RemoteSensing.jsx
new file mode 100644
index 0000000..1f0437b
--- /dev/null
+++ b/client/src/components/layout/Canvas/views/DashboardCanvasNav/RemoteSensing.jsx
@@ -0,0 +1,22 @@
+import { Box, Text } from "@chakra-ui/react";
+
+export function RemoteSensing() {
+ return(
+
+
+ Remote Sensing dashboard coming soon.
+
+
+ );
+}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/views/DashboardCanvasNav/Seismic.jsx b/client/src/components/layout/Canvas/views/DashboardCanvasNav/Seismic.jsx
new file mode 100644
index 0000000..42d2570
--- /dev/null
+++ b/client/src/components/layout/Canvas/views/DashboardCanvasNav/Seismic.jsx
@@ -0,0 +1,22 @@
+import { Box, Text } from "@chakra-ui/react";
+
+export function Seismic() {
+ return(
+
+
+ Seismic dashboard coming soon.
+
+
+ );
+}
\ No newline at end of file
diff --git a/client/src/components/layout/Canvas/views/WidgetCanvas.jsx b/client/src/components/layout/Canvas/views/DashboardCanvasNav/WidgetCanvas.jsx
similarity index 78%
rename from client/src/components/layout/Canvas/views/WidgetCanvas.jsx
rename to client/src/components/layout/Canvas/views/DashboardCanvasNav/WidgetCanvas.jsx
index f4389c9..7364386 100644
--- a/client/src/components/layout/Canvas/views/WidgetCanvas.jsx
+++ b/client/src/components/layout/Canvas/views/DashboardCanvasNav/WidgetCanvas.jsx
@@ -4,27 +4,16 @@
import { useState } from 'react';
import GridLayout, { WidthProvider } from 'react-grid-layout';
-import Widget from '../Widget.jsx';
+import Widget from '../../components/Widget.jsx';
import { useSlotRecipe, chakra, Flex } from '@chakra-ui/react';
-export default function WidgetCanvas({ layout, onLayoutChange, removeWidget }) {
+export default function WidgetCanvas({layout, onLayoutChange}) {
// Define widgets initial position and size
// TODO Add dynamic adding/deleting of widgets via options button
const recipe = useSlotRecipe({ key: "widget" });
const styles = recipe(); // using root recipe for widget below
const ResponsiveGridLayout = WidthProvider(GridLayout); // canvas width now adjusts to window size
- // const [layout, setLayout] = useState([
- // { i: '0', x: 0, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false },
- // { i: '1', x: 3, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false },
- // { i: '2', x: 6, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: false }
- // ]);
-
- // const onLayoutChange = (newLayout) => {
- // setLayout(newLayout);
- // console.log('Updated layout:', newLayout)
- // };
-
// don't allow text highlighting when dragging
const handleDragStart = () => {
document.body.style.userSelect = "none";