diff --git a/src/app/(outerbase)/nav-layout.tsx b/src/app/(outerbase)/nav-layout.tsx index a65a0dda..4aefe8e7 100644 --- a/src/app/(outerbase)/nav-layout.tsx +++ b/src/app/(outerbase)/nav-layout.tsx @@ -4,9 +4,10 @@ import { SidebarMenuItem, SidebarMenuLoadingItem, } from "@/components/sidebar-menu"; -import { Database, Plus } from "@phosphor-icons/react"; +import { cn } from "@/lib/utils"; +import { Database, List, Plus } from "@phosphor-icons/react"; import { useParams, usePathname, useRouter } from "next/navigation"; -import { PropsWithChildren } from "react"; +import { PropsWithChildren, useState } from "react"; import NavigationProfile from "./nav-profile"; import NavigationSigninBanner from "./nav-signin-banner"; import { useSession } from "./session-provider"; @@ -14,76 +15,101 @@ import { useWorkspaces } from "./workspace-provider"; export default function NavigationLayout({ children }: PropsWithChildren) { const router = useRouter(); + const [mobileToggle, setMobileToggle] = useState(false); const { session } = useSession(); const { workspaces, loading: workspaceLoading } = useWorkspaces(); const pathname = usePathname(); const { workspaceId } = useParams<{ workspaceId?: string }>(); return ( -
-
-
+
+
+
-
- -
- - { + setMobileToggle(!mobileToggle); + }} /> +
- {workspaces.map((workspace) => { - return ( - { - router.push(`/w/${workspace.short_name}`); - } - } - selected={workspace.short_name === workspaceId} - badge={ - !workspace.is_enterprise && - workspace.subscription.plan === "starter" ? ( - - Free - - ) : undefined - } - /> - ); - })} + {mobileToggle && ( +
{ + setMobileToggle(false); + }} + >
+ )} - {workspaceLoading && ( - <> - - - - + + + +
{children}