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.
This commit is contained in:
@@ -42,7 +42,6 @@ export default function EventDetailPage() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Navbar />
|
||||
<div className="container">
|
||||
<h1>{event.title}</h1>
|
||||
<p>{event.description}</p>
|
||||
|
||||
@@ -81,7 +81,6 @@ export default function CreateEventPage() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Navbar />
|
||||
<div className="container mx-auto px-4 py-12 max-w-4xl">
|
||||
<Card className="shadow-lg">
|
||||
<CardHeader>
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<Navbar />
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ export default function DashboardPage() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Navbar />
|
||||
<div className="container mx-auto px-4 py-12">
|
||||
<div className="max-w-7xl mx-auto">
|
||||
<h1 className="text-3xl font-bold mb-8">Dashboard</h1>
|
||||
|
||||
Reference in New Issue
Block a user