Nav Bar correction
This commit is contained in:
parent
e8182fc943
commit
be6b47fc80
@ -2,8 +2,8 @@ import type { Metadata } from "next";
|
||||
import { Inter } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { headers } from "next/headers";
|
||||
import { getServerSession } from "next-auth/next";
|
||||
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { authOptions } from "./api/auth/[...nextauth]/route";
|
||||
import { Providers } from "@/components/providers";
|
||||
import { LayoutWrapper } from "@/components/layout/layout-wrapper";
|
||||
import { Navbar } from "@/components/navbar";
|
||||
@ -33,11 +33,15 @@ export default async function RootLayout({
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<div className="min-h-screen bg-black">
|
||||
<Navbar />
|
||||
{children}
|
||||
</div>
|
||||
<Toaster />
|
||||
<Providers>
|
||||
<LayoutWrapper>
|
||||
<div className="min-h-screen bg-black">
|
||||
<Navbar />
|
||||
{children}
|
||||
</div>
|
||||
<Toaster />
|
||||
</LayoutWrapper>
|
||||
</Providers>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
47
components/navbar.tsx
Normal file
47
components/navbar.tsx
Normal file
@ -0,0 +1,47 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
label: "Dashboard",
|
||||
href: "/",
|
||||
},
|
||||
{
|
||||
label: "Flow",
|
||||
href: "/flow",
|
||||
},
|
||||
{
|
||||
label: "CRM",
|
||||
href: "/crm",
|
||||
},
|
||||
{
|
||||
label: "Management",
|
||||
href: "/management",
|
||||
},
|
||||
];
|
||||
|
||||
export function Navbar() {
|
||||
const pathname = usePathname();
|
||||
|
||||
return (
|
||||
<nav className="flex items-center space-x-4 lg:space-x-6 h-16 px-8 bg-black/20">
|
||||
{routes.map((route) => (
|
||||
<Link
|
||||
key={route.href}
|
||||
href={route.href}
|
||||
className={cn(
|
||||
"text-sm font-medium transition-colors hover:text-white",
|
||||
pathname === route.href
|
||||
? "text-white"
|
||||
: "text-white/60"
|
||||
)}
|
||||
>
|
||||
{route.label}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user