update laye out and update home page also create footer page

This commit is contained in:
m7amedez5511
2026-07-08 17:49:08 +03:00
parent c814c5b97c
commit 5707521b92
15 changed files with 182 additions and 84 deletions

View 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 />;
}

View 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>)
}

View File

@@ -176,6 +176,7 @@ export function Sidebar() {
flexShrink: 0,
minHeight: "100vh",
padding: "20px 12px",
}}
>
<SidebarContent

View File

@@ -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}

View File

@@ -0,0 +1,4 @@
export { default } from "./Navbar";
export { Sidebar } from "./Sidebar";
export { Footer } from "./Footer";
export { Topbar } from "./Topbar";