update laye out and update home page also create footer page
This commit is contained in:
16
app/components/layout/ConditionalNavbar.tsx
Normal file
16
app/components/layout/ConditionalNavbar.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { usePathname } from "next/navigation";
|
||||
import { getStoredUser } from "@/src/lib/auth";
|
||||
import Navbar from "./Navbar";
|
||||
|
||||
export default function ConditionalNavbar() {
|
||||
const pathname = usePathname();
|
||||
const user = getStoredUser();
|
||||
|
||||
// لو المستخدم مسجل دخول، أو الصفحة الحالية جوه الداشبورد، منظهرش الناف بار العام
|
||||
const isDashboardRoute = pathname?.startsWith("/dashboard");
|
||||
if (user || isDashboardRoute) return null;
|
||||
|
||||
return <Navbar />;
|
||||
}
|
||||
Reference in New Issue
Block a user