From 0d9620e246f14ad4b69a09e1292d5c2dc99cad2a Mon Sep 17 00:00:00 2001 From: mickasmt Date: Mon, 3 Jun 2024 00:02:41 +0200 Subject: [PATCH] refactor: updated navbar & mobile nav - improved layouts --- app/(dashboard)/dashboard/billing/loading.tsx | 12 +- app/(dashboard)/dashboard/loading.tsx | 18 +- app/(dashboard)/dashboard/page.tsx | 4 +- app/(dashboard)/{dashboard => }/layout.tsx | 6 +- app/(docs)/docs/layout.tsx | 5 +- app/(docs)/layout.tsx | 37 +--- app/(marketing)/layout.tsx | 5 +- app/(marketing)/pricing/loading.tsx | 8 +- components/dashboard/header.tsx | 12 +- components/docs/sidebar-nav.tsx | 25 ++- .../layout/{nav.tsx => dashboard-sidenav.tsx} | 0 components/layout/main-nav.tsx | 80 --------- components/layout/mobile-nav.tsx | 161 +++++++++++++----- components/layout/navbar.tsx | 107 ++++++++---- components/shared/card-skeleton.tsx | 15 +- components/shared/max-width-wrapper.tsx | 8 +- tailwind.config.ts | 2 +- 17 files changed, 273 insertions(+), 232 deletions(-) rename app/(dashboard)/{dashboard => }/layout.tsx (88%) rename components/layout/{nav.tsx => dashboard-sidenav.tsx} (100%) delete mode 100644 components/layout/main-nav.tsx diff --git a/app/(dashboard)/dashboard/billing/loading.tsx b/app/(dashboard)/dashboard/billing/loading.tsx index 4caab9fb..331e2776 100644 --- a/app/(dashboard)/dashboard/billing/loading.tsx +++ b/app/(dashboard)/dashboard/billing/loading.tsx @@ -1,6 +1,7 @@ -import { CardSkeleton } from "@/components/shared/card-skeleton" -import { DashboardHeader } from "@/components/dashboard/header" -import { DashboardShell } from "@/components/dashboard/shell" +import { Skeleton } from "@/components/ui/skeleton"; +import { DashboardHeader } from "@/components/dashboard/header"; +import { DashboardShell } from "@/components/dashboard/shell"; +import { CardSkeleton } from "@/components/shared/card-skeleton"; export default function DashboardBillingLoading() { return ( @@ -9,9 +10,10 @@ export default function DashboardBillingLoading() { heading="Billing" text="Manage billing and your subscription plan." /> -
+
+
- ) + ); } diff --git a/app/(dashboard)/dashboard/loading.tsx b/app/(dashboard)/dashboard/loading.tsx index 66dfffd9..ec744901 100644 --- a/app/(dashboard)/dashboard/loading.tsx +++ b/app/(dashboard)/dashboard/loading.tsx @@ -1,20 +1,14 @@ -import { CardSkeleton } from "@/components/shared/card-skeleton" -import { DashboardHeader } from "@/components/dashboard/header" -import { DashboardShell } from "@/components/dashboard/shell" -import { Button } from "@/components/ui/button" +import { Skeleton } from "@/components/ui/skeleton"; +import { DashboardHeader } from "@/components/dashboard/header"; +import { DashboardShell } from "@/components/dashboard/shell"; export default function DashboardLoading() { return ( - - - +
- - - - +
- ) + ); } diff --git a/app/(dashboard)/dashboard/page.tsx b/app/(dashboard)/dashboard/page.tsx index 18b8eb7b..d58afbc4 100644 --- a/app/(dashboard)/dashboard/page.tsx +++ b/app/(dashboard)/dashboard/page.tsx @@ -21,9 +21,7 @@ export default async function DashboardPage() { return ( - - - +
diff --git a/app/(dashboard)/dashboard/layout.tsx b/app/(dashboard)/layout.tsx similarity index 88% rename from app/(dashboard)/dashboard/layout.tsx rename to app/(dashboard)/layout.tsx index d93b6521..815144aa 100644 --- a/app/(dashboard)/dashboard/layout.tsx +++ b/app/(dashboard)/layout.tsx @@ -1,8 +1,8 @@ -import { dashboardConfig } from "@/config/dashboard"; -import { DashboardNav } from "@/components/layout/nav"; +import { DashboardNav } from "@/components/layout/dashboard-sidenav"; import { NavBar } from "@/components/layout/navbar"; import { SiteFooter } from "@/components/layout/site-footer"; import MaxWidthWrapper from "@/components/shared/max-width-wrapper"; +import { dashboardConfig } from "@/config/dashboard"; interface DashboardLayoutProps { children?: React.ReactNode; @@ -11,7 +11,7 @@ interface DashboardLayoutProps { export default function DashboardLayout({ children }: DashboardLayoutProps) { return (
- +
diff --git a/app/(docs)/docs/layout.tsx b/app/(docs)/docs/layout.tsx index f3a014ee..96f981b8 100644 --- a/app/(docs)/docs/layout.tsx +++ b/app/(docs)/docs/layout.tsx @@ -1,4 +1,3 @@ -import { docsConfig } from "@/config/docs"; import { ScrollArea } from "@/components/ui/scroll-area"; import { DocsSidebarNav } from "@/components/docs/sidebar-nav"; @@ -9,9 +8,9 @@ interface DocsLayoutProps { export default function DocsLayout({ children }: DocsLayoutProps) { return (
-