Refactor made changes to file structures
This commit is contained in:
+10
-10
@@ -2,16 +2,16 @@ import 'leaflet/dist/leaflet.css';
|
||||
import { Routes, Route, Navigate, Outlet } from 'react-router-dom';
|
||||
import { useRecipe, Grid, GridItem, useDialog, Flex, Heading } from "@chakra-ui/react";
|
||||
import { createContext } from "react";
|
||||
import Login from "@/Login.jsx";
|
||||
import Sidebar from "./components/Sidebar/Sidebar.jsx";
|
||||
import DialogPopup from "@/components/Canvas/CanvasComponents/DialogPopup.jsx";
|
||||
import Header from "@/components/Header/Header.jsx";
|
||||
import Home from "./components/Canvas/views/Home.jsx";
|
||||
import RegionalMap from "./components/Canvas/views/RegionalMap.jsx";
|
||||
import Volcano from "@/components/Canvas/views/Volcano.jsx";
|
||||
import GlobalMap from "./components/Canvas/views/GlobalMap.jsx";
|
||||
import Admin from "./components/Canvas/views/Admin.jsx";
|
||||
import MyDashboard from "./components/Canvas/views/HomeTabs/MyDashboard.jsx";
|
||||
import Login from "@/pages/auth/Login.jsx";
|
||||
import Sidebar from "./components/layout/Sidebar.jsx";
|
||||
import DialogPopup from "@/components/dashboard/DialogPopup.jsx";
|
||||
import Header from "@/components/layout/Header.jsx";
|
||||
import Home from "./pages/home/Home.jsx";
|
||||
import RegionalMap from "./pages/maps/RegionalMap.jsx";
|
||||
import Volcano from "@/pages/volcano/Volcano.jsx";
|
||||
import GlobalMap from "./pages/maps/GlobalMap.jsx";
|
||||
import Admin from "./pages/admin/Admin.jsx";
|
||||
import MyDashboard from "./pages/home/tabs/MyDashboard.jsx";
|
||||
|
||||
function AppFoundation() {
|
||||
const recipe = useRecipe({ key: "dashboard" });
|
||||
|
||||
+5
-5
@@ -13,21 +13,21 @@ import {
|
||||
HStack
|
||||
} from "@chakra-ui/react";
|
||||
import { Settings, Plus, LayoutGrid, Move, Save, X } from 'lucide-react';
|
||||
import { useDashboardStore } from "../store/useDashboardStore.jsx";
|
||||
import { WIDGET_REGISTRY } from "../constants/widgetRegistry.jsx";
|
||||
import { useDashboardStore } from "../../store/useDashboardStore.jsx";
|
||||
import { WIDGET_REGISTRY } from "../../constants/widgetRegistry.jsx";
|
||||
|
||||
export function SettingsButton() {
|
||||
// 1. ☁️ Store connections
|
||||
// 1. ☁Store connections
|
||||
const isEditing = useDashboardStore(state => state.isEditing);
|
||||
const enterEditMode = useDashboardStore(state => state.enterEditMode);
|
||||
const saveEdit = useDashboardStore(state => state.saveEdit);
|
||||
const cancelEdit = useDashboardStore(state => state.cancelEdit);
|
||||
const addWidget = useDashboardStore(state => state.addWidget);
|
||||
|
||||
// 2. 🎛️ Local state to control the Widget Library popup independently of the dropdown
|
||||
// 2. Local state to control the Widget Library popup independently of the dropdown
|
||||
const [isLibraryOpen, setIsLibraryOpen] = useState(false);
|
||||
|
||||
// 3. 🧠 Categorize widgets for the tabs
|
||||
// 3. Categorize widgets for the tabs
|
||||
const categorizedWidgets = useMemo(() => {
|
||||
return Object.entries(WIDGET_REGISTRY).reduce((acc, [id, widget]) => {
|
||||
const cat = widget.category || 'General';
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
import { Box, Menu, Portal } from '@chakra-ui/react'
|
||||
import WidgetMenu from './WidgetMenu';
|
||||
import AlertLevel from "@/components/Widgets/AlertLevelWidget.jsx";
|
||||
|
||||
export default function FirstWidgetButton({ appendWidget }) {
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { Menu, Portal } from "@chakra-ui/react";
|
||||
import AlertLevel from "../../Widgets/AlertLevelWidget.jsx";
|
||||
import AlertLevel from "../Widgets/AlertLevelWidget.jsx";
|
||||
|
||||
export default function WidgetMenu({appendWidget, triggerItem, positioning}) {
|
||||
return (
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import { useSlotRecipe, Box, Button, IconButton } from "@chakra-ui/react";
|
||||
import { ColorModeButton } from "@/components/ui/color-mode";
|
||||
import { ColorModeButton } from "@/components/ui/color-mode.jsx";
|
||||
import { useState } from "react";
|
||||
import { NavLink } from "react-router-dom";
|
||||
import Tooltip from "../Canvas/CanvasComponents/Tooltip.jsx";
|
||||
import Tooltip from "../ui/Tooltip.jsx";
|
||||
import { Mountain, House, Earth, MapPin, ShieldUser, Menu } from 'lucide-react';
|
||||
|
||||
const SIDEBAR_DEFAULT_BUTTONS = [
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Flex, Tabs, HStack } from '@chakra-ui/react';
|
||||
import { MEDataEntry } from './AdminTabs/MEDataEntry';
|
||||
import { ProjectCollector } from './AdminTabs/ProjectCollector';
|
||||
import { NASApplication } from './AdminTabs/NASApplication';
|
||||
import { IVANS } from './AdminTabs/IVANS'
|
||||
import { SearchBar } from "../CanvasComponents/SearchBar";
|
||||
import { SettingsButton } from "../../SettingsButton.jsx";
|
||||
import { CanvasHeaderTabs } from '../CanvasComponents/CanvasHeaderTabs';
|
||||
import { ADMIN_TABS } from '@/constants/viewKeys';
|
||||
import { MEDataEntry } from './tabs/MEDataEntry.jsx';
|
||||
import { ProjectCollector } from './tabs/ProjectCollector.jsx';
|
||||
import { NASApplication } from './tabs/NASApplication.jsx';
|
||||
import { IVANS } from './tabs/IVANS.jsx'
|
||||
import { SearchBar } from "../../components/dashboard/SearchBar.jsx";
|
||||
import { SettingsButton } from "../../components/dashboard/SettingsButton.jsx";
|
||||
import { CanvasHeaderTabs } from '../../components/dashboard/CanvasHeaderTabs.jsx';
|
||||
import { ADMIN_TABS } from '@/constants/viewKeys.js';
|
||||
|
||||
// TODO - refactor this. Currently Admin doesn't use onEditWidgets or appendWidget
|
||||
export default function Admin({ view, onChangeView, onEditWidgets, appendWidget }) {
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import { Box, Button, ButtonGroup, Text, Input, List, Field, Stack, SimpleGrid, HStack, Table, Checkbox, createListCollection } from "@chakra-ui/react"
|
||||
import DropDownMenu from "../../CanvasComponents/DropDownMenu"
|
||||
import DropDownMenu from "../../../components/dashboard/DropDownMenu.jsx"
|
||||
import { useForm } from 'react-hook-form';
|
||||
|
||||
const startYear = 1970;
|
||||
@@ -1,7 +1,7 @@
|
||||
import { HStack, Flex, Box } from "@chakra-ui/react";
|
||||
import { NavLink, Outlet, useLocation } from "react-router-dom";
|
||||
import { SearchBar } from "../CanvasComponents/SearchBar";
|
||||
import { SettingsButton } from "../../SettingsButton.jsx";
|
||||
import { SearchBar } from "../../components/dashboard/SearchBar.jsx";
|
||||
import { SettingsButton } from "../../components/dashboard/SettingsButton.jsx";
|
||||
|
||||
export default function Home() {
|
||||
const location = useLocation();
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
|
||||
import MapButtonControls from "../CanvasComponents/MapButtonControls";
|
||||
import MapSettingsButton from "../CanvasComponents/MapSettingsButton";
|
||||
import MapButtonControls from "../../components/maps/MapButtonControls.jsx";
|
||||
import MapSettingsButton from "../../components/maps/MapSettingsButton.jsx";
|
||||
|
||||
export default function GlobalMap() {
|
||||
const position = [45.61142478054226, -122.49630033167544]; // [latitude, longitude]
|
||||
+9
-9
@@ -1,14 +1,14 @@
|
||||
import { Box, Text, Heading, DataList, Flex, HStack, Tabs } from '@chakra-ui/react';
|
||||
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
|
||||
import { CanvasHeaderTabs } from '../CanvasComponents/CanvasHeaderTabs';
|
||||
import { VOLCANO_TABS } from '@/constants/viewKeys';
|
||||
import { VolcanoHome } from './VolcanoTabs/VolcanoHome';
|
||||
import { PartnerData } from './VolcanoTabs/PartnerData';
|
||||
import { Reports } from './VolcanoTabs/Reports';
|
||||
import { OfficialInstitutions } from './VolcanoTabs/OfficialInstitutions';
|
||||
import { SocialMedia } from './VolcanoTabs/SocialMedia';
|
||||
import { SearchBar } from "../CanvasComponents/SearchBar";
|
||||
import { SettingsButton } from "../../SettingsButton.jsx";
|
||||
import { CanvasHeaderTabs } from '../../components/dashboard/CanvasHeaderTabs.jsx';
|
||||
import { VOLCANO_TABS } from '@/constants/viewKeys.js';
|
||||
import { VolcanoHome } from './tabs/VolcanoHome.jsx';
|
||||
import { PartnerData } from './tabs/PartnerData.jsx';
|
||||
import { Reports } from './tabs/Reports.jsx';
|
||||
import { OfficialInstitutions } from './tabs/OfficialInstitutions.jsx';
|
||||
import { SocialMedia } from './tabs/SocialMedia.jsx';
|
||||
import { SearchBar } from "../../components/dashboard/SearchBar.jsx";
|
||||
import { SettingsButton } from "../../components/dashboard/SettingsButton.jsx";
|
||||
|
||||
export default function Volcano() {
|
||||
return (
|
||||
Reference in New Issue
Block a user