From 8b0c30f19f81de93678a9544a91fe4fbc93bb762 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Sun, 13 Apr 2025 14:21:18 -0400 Subject: [PATCH] more tweaks to layout --- src/app/[orgId]/page.tsx | 2 +- .../settings/access/users/[userId]/layout.tsx | 26 +---- src/app/[orgId]/settings/layout.tsx | 48 +-------- .../[resourceId]/connectivity/page.tsx | 2 +- .../resources/[resourceId]/rules/page.tsx | 3 +- src/app/admin/layout.tsx | 11 +- src/app/globals.css | 1 + src/app/navigation.tsx | 52 +++++---- src/app/page.tsx | 2 +- src/app/setup/layout.tsx | 26 ++--- src/components/Breadcrumbs.tsx | 8 +- src/components/Header.tsx | 2 +- src/components/HorizontalTabs.tsx | 3 +- src/components/Layout.tsx | 29 +++-- src/components/SidebarNav.tsx | 12 ++- src/components/TopBar.tsx | 2 +- src/components/tags/autocomplete.tsx | 2 +- src/components/ui/button.tsx | 2 +- src/components/ui/data-table.tsx | 27 +++-- src/components/ui/form.tsx | 101 +++++++++--------- src/components/ui/input-otp.tsx | 2 +- src/components/ui/switch.tsx | 2 +- 22 files changed, 172 insertions(+), 193 deletions(-) diff --git a/src/app/[orgId]/page.tsx b/src/app/[orgId]/page.tsx index b009da1c..438ebbe4 100644 --- a/src/app/[orgId]/page.tsx +++ b/src/app/[orgId]/page.tsx @@ -45,7 +45,7 @@ export default async function OrgPage(props: OrgPageProps) { return ( - diff --git a/src/app/[orgId]/settings/access/users/[userId]/layout.tsx b/src/app/[orgId]/settings/access/users/[userId]/layout.tsx index 1419de92..342e8b7c 100644 --- a/src/app/[orgId]/settings/access/users/[userId]/layout.tsx +++ b/src/app/[orgId]/settings/access/users/[userId]/layout.tsx @@ -14,6 +14,7 @@ import { } from "@app/components/ui/breadcrumb"; import Link from "next/link"; import { cache } from "react"; +import SettingsSectionTitle from "@app/components/SettingsSectionTitle"; interface UserLayoutProps { children: React.ReactNode; @@ -48,28 +49,11 @@ export default async function UserLayoutProps(props: UserLayoutProps) { return ( <> + -
- - - - Users - - - - {user.email} - - - -
- -
-

- User {user?.email} -

-

Manage user

-
- {children} diff --git a/src/app/[orgId]/settings/layout.tsx b/src/app/[orgId]/settings/layout.tsx index 3ec16be4..206f52f9 100644 --- a/src/app/[orgId]/settings/layout.tsx +++ b/src/app/[orgId]/settings/layout.tsx @@ -18,6 +18,7 @@ import { GetOrgUserResponse } from "@server/routers/user"; import UserProvider from "@app/providers/UserProvider"; import { Layout } from "@app/components/Layout"; import { SidebarNavItem, SidebarNavProps } from "@app/components/SidebarNav"; +import { orgNavItems } from "@app/app/navigation"; export const dynamic = "force-dynamic"; @@ -26,51 +27,6 @@ export const metadata: Metadata = { description: "" }; -const navItems: SidebarNavItem[] = [ - { - title: "Sites", - href: "/{orgId}/settings/sites" - // icon: - }, - { - title: "Resources", - href: "/{orgId}/settings/resources" - // icon: - }, - { - title: "Access Control", - href: "/{orgId}/settings/access", - // icon: , - autoExpand: true, - children: [ - { - title: "Users", - href: "/{orgId}/settings/access/users", - children: [ - { - title: "Invitations", - href: "/{orgId}/settings/access/invitations" - } - ] - }, - { - title: "Roles", - href: "/{orgId}/settings/access/roles" - } - ] - }, - { - title: "Shareable Links", - href: "/{orgId}/settings/share-links" - // icon: - }, - { - title: "General", - href: "/{orgId}/settings/general" - // icon: - } -]; - interface SettingsLayoutProps { children: React.ReactNode; params: Promise<{ orgId: string }>; @@ -119,7 +75,7 @@ export default async function SettingsLayout(props: SettingsLayoutProps) { return ( - + {children} diff --git a/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx b/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx index 29841bf5..f0dd8978 100644 --- a/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx +++ b/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx @@ -569,7 +569,7 @@ export default function ReverseProxyTargets(props: { diff --git a/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx b/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx index e85d6f3b..2a9fa00f 100644 --- a/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx +++ b/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx @@ -693,7 +693,7 @@ export default function ResourceRules(props: { control={addRuleForm.control} name="value" render={({ field }) => ( - + Add Rule diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx index a1f981d7..ddef0a05 100644 --- a/src/app/admin/layout.tsx +++ b/src/app/admin/layout.tsx @@ -9,6 +9,7 @@ import { internal } from "@app/lib/api"; import { AxiosResponse } from "axios"; import { authCookieHeader } from "@app/lib/api/cookies"; import { Layout } from "@app/components/Layout"; +import { adminNavItems } from "../navigation"; export const dynamic = "force-dynamic"; @@ -17,14 +18,6 @@ export const metadata: Metadata = { description: "" }; -const navItems = [ - { - title: "All Users", - href: "/admin/users", - icon: - } -]; - interface LayoutProps { children: React.ReactNode; } @@ -51,7 +44,7 @@ export default async function AdminLayout(props: LayoutProps) { return ( - + {props.children} diff --git a/src/app/globals.css b/src/app/globals.css index 6d701a49..7afe6079 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,3 +1,4 @@ +@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@300..700&display=swap"); @import 'tailwindcss'; @custom-variant dark (&:is(.dark *)); diff --git a/src/app/navigation.tsx b/src/app/navigation.tsx index c9824d63..91a1f52c 100644 --- a/src/app/navigation.tsx +++ b/src/app/navigation.tsx @@ -1,33 +1,37 @@ -import { Home, Settings, Users, Link as LinkIcon, Waypoints, Combine } from "lucide-react"; +import { SidebarNavItem } from "@app/components/SidebarNav"; +import { + Home, + Settings, + Users, + Link as LinkIcon, + Waypoints, + Combine +} from "lucide-react"; -export const rootNavItems = [ +export const rootNavItems: SidebarNavItem[] = [ { title: "Home", - href: "/", - icon: + href: "/" + // icon: } ]; -export const orgNavItems = [ - { - title: "Overview", - href: "/{orgId}", - icon: - }, +export const orgNavItems: SidebarNavItem[] = [ { title: "Sites", - href: "/{orgId}/settings/sites", - icon: + href: "/{orgId}/settings/sites" + // icon: }, { title: "Resources", - href: "/{orgId}/settings/resources", - icon: + href: "/{orgId}/settings/resources" + // icon: }, { title: "Access Control", href: "/{orgId}/settings/access", - icon: , + // icon: , + autoExpand: true, children: [ { title: "Users", @@ -41,12 +45,20 @@ export const orgNavItems = [ }, { title: "Shareable Links", - href: "/{orgId}/settings/share-links", - icon: + href: "/{orgId}/settings/share-links" + // icon: }, { title: "Settings", - href: "/{orgId}/settings/general", - icon: + href: "/{orgId}/settings/general" + // icon: } -]; \ No newline at end of file +]; + +export const adminNavItems: SidebarNavItem[] = [ + { + title: "All Users", + href: "/admin/users" + // icon: + } +]; diff --git a/src/app/page.tsx b/src/app/page.tsx index e2f06431..3535c65f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -71,7 +71,7 @@ export default async function Page(props: { return ( - -
- {user && ( - -
- -
-
- )} - -
- {children} -
-
+ + +
+ {children} +
+
+
); } diff --git a/src/components/Breadcrumbs.tsx b/src/components/Breadcrumbs.tsx index 02a856b7..9db2db2a 100644 --- a/src/components/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs.tsx @@ -26,7 +26,7 @@ export function Breadcrumbs() { } else if (segment === "resources") { label = "Resources"; } else if (segment === "access") { - label = "Users & Roles"; + label = "Access Control"; } else if (segment === "general") { label = "General"; } else if (segment === "share-links") { @@ -48,14 +48,14 @@ export function Breadcrumbs() { return (
-