diff --git a/pkgs/ui/src/app/layout.tsx b/pkgs/ui/src/app/layout.tsx index 4fffb2b2a..4cef02cb6 100644 --- a/pkgs/ui/src/app/layout.tsx +++ b/pkgs/ui/src/app/layout.tsx @@ -17,8 +17,7 @@ import { Toaster } from "react-hot-toast"; import "./globals.css"; import { darkTheme, lightTheme } from "./theme/themes"; -import Background from "@/components/background"; -import { AppContext, WithAppState } from "@/components/hooks/useAppContext"; +import { WithAppState } from "@/components/hooks/useAppContext"; const roboto = localFont({ src: [ @@ -58,61 +57,47 @@ export default function RootLayout({ - - {(appState) => { - const showSidebarDerived = Boolean( - showSidebar && !appState.isLoading && appState.data.isJoined - ); - return ( - <> - -
- - setShowSidebar(false)} - /> - -
+ + setShowSidebar(false)} + /> + +
+
+
+
+
+ {!showSidebar && } +
- - ); - }} - +
+ Clan Logo +
+
+
+ +
+
+
{children}
+
+
+
+
diff --git a/pkgs/ui/src/app/page.tsx b/pkgs/ui/src/app/page.tsx index e8bcab4d2..4f095d173 100644 --- a/pkgs/ui/src/app/page.tsx +++ b/pkgs/ui/src/app/page.tsx @@ -1,75 +1,27 @@ -"use client"; import { NetworkOverview } from "@/components/dashboard/NetworkOverview"; import { RecentActivity } from "@/components/dashboard/activity"; import { AppOverview } from "@/components/dashboard/appOverview"; import { Notifications } from "@/components/dashboard/notifications"; import { QuickActions } from "@/components/dashboard/quickActions"; import { TaskQueue } from "@/components/dashboard/taskQueue"; -import { useAppState } from "@/components/hooks/useAppContext"; -import { LoadingOverlay } from "@/components/join/loadingOverlay"; -import JoinPrequel from "@/views/joinPrequel"; - -// interface DashboardCardProps { -// children?: React.ReactNode; -// rowSpan?: number; -// sx?: string; -// } -// const DashboardCard = (props: DashboardCardProps) => { -// const { children, rowSpan, sx = "" } = props; -// return ( -// //
-//
-// {children} -//
-// ); -// }; - -// interface DashboardPanelProps { -// children?: React.ReactNode; -// } -// const DashboardPanel = (props: DashboardPanelProps) => { -// const { children } = props; -// return ( -//
{children}
-// ); -// }; export default function Dashboard() { - const { data, isLoading } = useAppState(); - if (isLoading) { - return ( -
-
- + return ( +
+
+
+
-
- ); - } - if (!data.isJoined) { - return ; - } - if (data.isJoined) { - return ( -
-
-
- -
-
- -
-
- -
- - - +
+
+
+ +
+ + +
- ); - } +
+ ); } diff --git a/pkgs/ui/src/components/background.tsx b/pkgs/ui/src/components/background.tsx index ff90bbfaf..1899c5a86 100644 --- a/pkgs/ui/src/components/background.tsx +++ b/pkgs/ui/src/components/background.tsx @@ -3,18 +3,15 @@ import { default as clanDark, default as clanLight, } from "../../public/clan-dark.png"; -import { useAppState } from "./hooks/useAppContext"; export default function Background() { - const { data, isLoading } = useAppState(); - return (
- {(isLoading || !data.isJoined) && ( + { <> - )} + }
); } diff --git a/pkgs/ui/src/components/sidebar/index.tsx b/pkgs/ui/src/components/sidebar/index.tsx index 4f87c8ef5..d46f3c62d 100644 --- a/pkgs/ui/src/components/sidebar/index.tsx +++ b/pkgs/ui/src/components/sidebar/index.tsx @@ -11,18 +11,18 @@ import Image from "next/image"; import { ReactNode } from "react"; import { tw } from "@/utils/tailwind"; -import AppsIcon from "@mui/icons-material/Apps"; import BackupIcon from "@mui/icons-material/Backup"; import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; import DashboardIcon from "@mui/icons-material/Dashboard"; import DevicesIcon from "@mui/icons-material/Devices"; +import WorkspacesIcon from "@mui/icons-material/Workspaces"; import Link from "next/link"; type MenuEntry = { icon: ReactNode; label: string; to: string; - disabled: boolean; + disabled?: boolean; } & { subMenuEntries?: MenuEntry[]; }; @@ -32,19 +32,16 @@ const menuEntries: MenuEntry[] = [ icon: , label: "Dashoard", to: "/", - disabled: false, }, { icon: , label: "Machines", to: "/machines", - disabled: false, }, { - icon: , - label: "Applications", - to: "/applications", - disabled: true, + icon: , + label: "Manage", + to: "/join", }, { icon: ,