fixed barnavigation
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import BarNavigation from "../BarNavigation/BarNavigation";
|
||||
import header from "./Header.module.css";
|
||||
import BarNavigationServicio from "../BarNavigation/BarNavigationServicio";
|
||||
import { cookies } from "next/headers";
|
||||
import { jwtVerify } from "jose";
|
||||
import { redirect } from "next/navigation";
|
||||
import HeaderNavigation from "./HeaderNavigation";
|
||||
|
||||
const secret = new TextEncoder().encode(process.env.JWT_SECRET);
|
||||
|
||||
@@ -44,11 +42,7 @@ export default async function Header() {
|
||||
</Link>
|
||||
<div className={header.yellowPart}></div>
|
||||
<div className={header.containerBarNav}>
|
||||
{role === 1 && <BarNavigation />}
|
||||
{role === 4 && <BarNavigation />}
|
||||
|
||||
{role === 2 && <BarNavigationServicio/>}
|
||||
{role === 3 && <BarNavigationServicio/>}
|
||||
<HeaderNavigation role={role} />
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import { usePathname } from "next/navigation";
|
||||
import BarNavigation from "../BarNavigation/BarNavigation";
|
||||
import BarNavigationServicio from "../BarNavigation/BarNavigationServicio";
|
||||
|
||||
export default function HeaderNavigation({ role }: { role: number }) {
|
||||
const pathname = usePathname();
|
||||
|
||||
if (pathname === "/") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{role === 1 && <BarNavigation />}
|
||||
{role === 4 && <BarNavigation />}
|
||||
{role === 2 && <BarNavigationServicio />}
|
||||
{role === 3 && <BarNavigationServicio />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user