From ad0f9f107823fb6dccd296f3922ec28d081ecce3 Mon Sep 17 00:00:00 2001 From: Felipe Cardoso Date: Wed, 12 Mar 2025 09:56:03 +0100 Subject: [PATCH] Refactor: Move Navbar to MainLayout for consistency Relocated the Navbar component to the MainLayout to streamline its rendering across dashboard pages. This eliminates redundant Navbar instances in individual pages, improving maintainability and reducing duplication. --- frontend/src/app/(main)/dashboard/events/[slug]/page.tsx | 1 - frontend/src/app/(main)/dashboard/events/new/page.tsx | 1 - frontend/src/app/(main)/dashboard/layout.tsx | 8 +++++++- frontend/src/app/(main)/dashboard/page.tsx | 1 - 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/(main)/dashboard/events/[slug]/page.tsx b/frontend/src/app/(main)/dashboard/events/[slug]/page.tsx index 091f0c5..350040a 100644 --- a/frontend/src/app/(main)/dashboard/events/[slug]/page.tsx +++ b/frontend/src/app/(main)/dashboard/events/[slug]/page.tsx @@ -42,7 +42,6 @@ export default function EventDetailPage() { return ( <> -

{event.title}

{event.description}

diff --git a/frontend/src/app/(main)/dashboard/events/new/page.tsx b/frontend/src/app/(main)/dashboard/events/new/page.tsx index aba17f1..bc7ffa6 100644 --- a/frontend/src/app/(main)/dashboard/events/new/page.tsx +++ b/frontend/src/app/(main)/dashboard/events/new/page.tsx @@ -81,7 +81,6 @@ export default function CreateEventPage() { return ( <> -
diff --git a/frontend/src/app/(main)/dashboard/layout.tsx b/frontend/src/app/(main)/dashboard/layout.tsx index 4c52390..400657c 100644 --- a/frontend/src/app/(main)/dashboard/layout.tsx +++ b/frontend/src/app/(main)/dashboard/layout.tsx @@ -3,6 +3,7 @@ import { useAuth } from "@/context/auth-context"; import { useRouter } from "next/navigation"; import { useEffect } from "react"; +import Navbar from "@/components/layout/navbar"; export default function MainLayout({ children, @@ -37,5 +38,10 @@ export default function MainLayout({ ); } - return <>{children}; + return ( + <> + + {children} + + ); } diff --git a/frontend/src/app/(main)/dashboard/page.tsx b/frontend/src/app/(main)/dashboard/page.tsx index 0cfc78e..6366df7 100644 --- a/frontend/src/app/(main)/dashboard/page.tsx +++ b/frontend/src/app/(main)/dashboard/page.tsx @@ -25,7 +25,6 @@ export default function DashboardPage() { return ( <> -

Dashboard