Overhaul (#83)

* WIP Layout Refactor

* New Connection Dialog

* WIP form overhaul

* Fix remaining config pages
This commit is contained in:
Sacha Weatherstone
2023-02-12 15:31:25 +11:00
committed by GitHub
parent c184c5add6
commit e59fe138f1
121 changed files with 5358 additions and 4701 deletions
+25 -21
View File
@@ -2,41 +2,45 @@ import { MapProvider } from "react-map-gl";
import { useAppStore } from "@core/stores/appStore.js";
import { DeviceWrapper } from "@app/DeviceWrapper.js";
import { PageRouter } from "@app/PageRouter.js";
import { CommandPalette } from "@components/CommandPalette/Index.js";
import { CommandPalette } from "@components/CommandPalette.js";
import { DeviceSelector } from "@components/DeviceSelector.js";
import { DialogManager } from "@components/Dialog/DialogManager.js";
import { NewDevice } from "@components/NewDevice.js";
import { Sidebar } from "@components/Sidebar.js";
import { Dashboard } from "@app/components/Dashboard.js";
import { useDeviceStore } from "@core/stores/deviceStore.js";
import { Drawer } from "@components/Drawer/index.js";
import { ThemeController } from "@components/generic/ThemeController.js";
import { BottomNav } from "@app/Nav/BottomNav.js";
import { NewDeviceDialog } from "./components/Dialog/NewDevice.js";
export const App = (): JSX.Element => {
const { getDevice } = useDeviceStore();
const { selectedDevice, darkMode, accent } = useAppStore();
const { selectedDevice, setConnectDialogOpen, connectDialogOpen } =
useAppStore();
const device = getDevice(selectedDevice);
return (
<ThemeController>
<NewDeviceDialog
open={connectDialogOpen}
onOpenChange={(open) => {
setConnectDialogOpen(open);
}}
/>
<MapProvider>
<DeviceWrapper device={device}>
<div className="flex bg-backgroundSecondary">
<DeviceSelector />
<div className="flex flex-grow flex-col">
{device ? (
<div className="flex flex-grow">
<DialogManager />
<CommandPalette />
<Sidebar />
<PageRouter />
</div>
) : (
<NewDevice />
)}
<BottomNav>{device && <Drawer />}</BottomNav>
<div className="flex min-h-screen flex-col bg-backgroundPrimary text-textPrimary">
<div className="flex flex-grow">
<DeviceSelector />
<div className="flex flex-grow flex-col">
{device ? (
<div className="flex flex-grow">
<DialogManager />
<CommandPalette />
<PageRouter />
</div>
) : (
<Dashboard />
)}
</div>
</div>
</div>
</DeviceWrapper>