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 />;
|
||||
}
|
||||
13
app/components/layout/Footer.tsx
Normal file
13
app/components/layout/Footer.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import Logo from "@/src/utils/logo";
|
||||
|
||||
export function Footer() {
|
||||
return (
|
||||
<footer className="bg-[#0F172A] text-white">
|
||||
<div className="mx-auto flex w-full max-w-7xl flex-col gap-4 px-6 py-6 text-[13px] lg:flex-row lg:items-center lg:justify-between lg:px-8">
|
||||
<Logo white={true} />
|
||||
<div className="text-center text-white/40">
|
||||
© 2026 Slash.sa. جميع الحقوق محفوظة.
|
||||
</div>
|
||||
</div>
|
||||
</footer>)
|
||||
}
|
||||
@@ -176,6 +176,7 @@ export function Sidebar() {
|
||||
flexShrink: 0,
|
||||
minHeight: "100vh",
|
||||
padding: "20px 12px",
|
||||
|
||||
}}
|
||||
>
|
||||
<SidebarContent
|
||||
|
||||
@@ -28,7 +28,6 @@ export function Topbar() {
|
||||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
{/* عنوان الصفحة */}
|
||||
<div>
|
||||
<p style={{ fontSize: 14, fontWeight: 600, color: "var(--color-text-primary)", margin: 0, textAlign: "start" }}>
|
||||
لوحة التحكم
|
||||
@@ -38,15 +37,21 @@ export function Topbar() {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* أكشنز */}
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 10 }}>
|
||||
|
||||
{/* زرار المنيو — sm فقط، globals.css بتتحكم في الـ display */}
|
||||
<div id="topbar-menu-btn">
|
||||
<BrandIconButton onClick={() => setOpen(true)} />
|
||||
</div>
|
||||
|
||||
{/* الدور */}
|
||||
{/* زرار "حسابي" — بيروح لصفحة البروفايل، مع hover بيغير اللون ويعمل scale بسيط */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => router.push("/dashboard/profile")}
|
||||
className="group flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 px-3 py-[5px] text-xs font-medium text-slate-600 transition-all duration-150 hover:scale-105 hover:border-blue-200 hover:bg-blue-50 hover:text-blue-600"
|
||||
>
|
||||
<i className="ti ti-user text-[14px]" aria-hidden="true" />
|
||||
حسابي
|
||||
</button>
|
||||
|
||||
<div
|
||||
suppressHydrationWarning
|
||||
style={{
|
||||
@@ -61,7 +66,6 @@ export function Topbar() {
|
||||
{user?.role ?? "—"}
|
||||
</div>
|
||||
|
||||
{/* خروج */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleLogout}
|
||||
|
||||
4
app/components/layout/index.ts
Normal file
4
app/components/layout/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export { default } from "./Navbar";
|
||||
export { Sidebar } from "./Sidebar";
|
||||
export { Footer } from "./Footer";
|
||||
export { Topbar } from "./Topbar";
|
||||
Reference in New Issue
Block a user