diff --git a/server/routers/user/listUsers.ts b/server/routers/user/listUsers.ts index 2b4a5d42..fd2291d5 100644 --- a/server/routers/user/listUsers.ts +++ b/server/routers/user/listUsers.ts @@ -114,7 +114,7 @@ export async function listUsers( const [{ count }] = await db .select({ count: sql`count(*)` }) - .from(users) + .from(userOrgs) .where(eq(userOrgs.orgId, orgId)); return response(res, { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 61bbb601..1d8deaed 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,13 @@ import type { Metadata } from "next"; import "./globals.css"; -import { Figtree, Inter, Red_Hat_Display, Red_Hat_Mono, Red_Hat_Text, Space_Grotesk } from "next/font/google"; +import { + Figtree, + Inter, + Red_Hat_Display, + Red_Hat_Mono, + Red_Hat_Text, + Space_Grotesk +} from "next/font/google"; import { Toaster } from "@/components/ui/toaster"; import { ThemeProvider } from "@app/providers/ThemeProvider"; import EnvProvider from "@app/providers/EnvProvider"; diff --git a/src/components/Breadcrumbs.tsx b/src/components/Breadcrumbs.tsx index 6d87f335..3f170fbe 100644 --- a/src/components/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs.tsx @@ -47,24 +47,22 @@ export function Breadcrumbs() { }); return ( -
- -
+ ); } diff --git a/src/components/Header.tsx b/src/components/Header.tsx deleted file mode 100644 index 943f65ed..00000000 --- a/src/components/Header.tsx +++ /dev/null @@ -1,30 +0,0 @@ -"use client"; - -import Link from "next/link"; -import { useEnvContext } from "@app/hooks/useEnvContext"; -import Image from "next/image"; - -interface HeaderProps { - orgId?: string; - orgs?: any; -} - -export function Header({ orgId, orgs }: HeaderProps) { - const { env } = useEnvContext(); - - return ( -
- - Pangolin Logo - Pangolin - -
- ); -} - -export default Header; diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 870d9b64..2df370d0 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,16 +1,15 @@ "use client"; import React, { useState } from "react"; -import { Header } from "@app/components/Header"; import { SidebarNav } from "@app/components/SidebarNav"; -import { TopBar } from "@app/components/TopBar"; import { OrgSelector } from "@app/components/OrgSelector"; import { cn } from "@app/lib/cn"; import { ListOrgsResponse } from "@server/routers/org"; import SupporterStatus from "@app/components/SupporterStatus"; -import { Separator } from "@app/components/ui/separator"; import { Button } from "@app/components/ui/button"; import { ExternalLink, Menu, X, Server } from "lucide-react"; +import Image from "next/image"; +import ProfileIcon from "@app/components/ProfileIcon"; import { Sheet, SheetContent, @@ -61,139 +60,185 @@ export function Layout({ const { user } = useUserContext(); return ( -
- {/* Mobile Menu Button */} - {showSidebar && ( -
- - - - - - - Navigation Menu - - - Main navigation menu for the application - - {showHeader && ( -
-
+
+ {/* Full width header */} + {showHeader && ( +
+
+
+ {showSidebar && ( +
+ + + + + + + Navigation Menu + + + Main navigation menu for the + application + +
+
+ + setIsMobileMenuOpen( + false + ) + } + /> +
+ {!isAdminPage && ( +
+ + setIsMobileMenuOpen(false) + } + > + + Server Admin + +
+ )} +
+
+ + + {env?.app?.version && ( +
+ v{env.app.version} +
+ )} +
+
+
)} -
- - setIsMobileMenuOpen(false) - } + + Pangolin Logo - {!isAdminPage && ( -
- - setIsMobileMenuOpen(false) - } - > - - Server Admin - -
- )} + + {showBreadcrumbs && ( +
+ +
+ )} +
+ {showTopBar && ( +
+
+ + Documentation + + + Support + +
+
+ +
-
- - + )} +
+ {showBreadcrumbs && ( +
+ +
+ )} +
+ )} + +
+ {/* Desktop Sidebar */} + {showSidebar && ( +
+
+
+ +
+ {!isAdminPage && user.serverAdmin && ( +
+ + + Server Admin + +
+ )} +
+
+ + +
+
+ + Open Source + + +
{env?.app?.version && (
v{env.app.version}
)}
- - -
- )} - - {/* Desktop Sidebar */} - {showSidebar && ( -
- {showHeader && ( -
-
+
+ )} + + {/* Main content */} +
-
- + > +
+
+ {children}
- {!isAdminPage && user.serverAdmin && ( -
- - - Server Admin - -
- )} -
-
- - -
-
- - Open Source - - -
- {env?.app?.version && ( -
- v{env.app.version} -
- )} -
-
+
- )} - - {/* Main content */} -
- {showTopBar && ( -
-
- -
-
- )} - {showBreadcrumbs && } -
-
- {children} -
-
); diff --git a/src/components/ProfileIcon.tsx b/src/components/ProfileIcon.tsx index 71b81465..d63598b6 100644 --- a/src/components/ProfileIcon.tsx +++ b/src/components/ProfileIcon.tsx @@ -66,7 +66,7 @@ export default function ProfileIcon() { -
+
{user.email || user.name || user.username} diff --git a/src/components/SidebarNav.tsx b/src/components/SidebarNav.tsx index 99c52d18..6a7aec25 100644 --- a/src/components/SidebarNav.tsx +++ b/src/components/SidebarNav.tsx @@ -129,22 +129,20 @@ export function SidebarNav({ aria-disabled={disabled} > {item.icon && ( - - {item.icon} - + {item.icon} )} {item.title} {hasChildren && ( )} diff --git a/src/components/TopBar.tsx b/src/components/TopBar.tsx deleted file mode 100644 index 2862da43..00000000 --- a/src/components/TopBar.tsx +++ /dev/null @@ -1,37 +0,0 @@ -"use client"; - -import ProfileIcon from "@app/components/ProfileIcon"; -import Link from "next/link"; - -interface TopBarProps { - orgId?: string; - orgs?: any; -} - -export function TopBar({ orgId, orgs }: TopBarProps) { - return ( -
-
- - Documentation - - - Support - -
-
- -
-
- ); -} diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx index ab2c497d..d0c877e7 100644 --- a/src/components/ui/dialog.tsx +++ b/src/components/ui/dialog.tsx @@ -38,7 +38,7 @@ const DialogContent = React.forwardRef<