From 5707521b929493a536c1b4d4327e66083d459bde Mon Sep 17 00:00:00 2001 From: m7amedez5511 Date: Wed, 8 Jul 2026 17:49:08 +0300 Subject: [PATCH] update laye out and update home page also create footer page --- app/components/layout/ConditionalNavbar.tsx | 16 ++++++ app/components/layout/Footer.tsx | 13 +++++ app/components/layout/Sidebar.tsx | 1 + app/components/layout/Topbar.tsx | 16 ++++-- app/components/layout/index.ts | 4 ++ app/dashboard/profile/page.tsx | 62 +++++++++++++++++++++ app/features/page.tsx | 13 +---- app/frequently_asked_questions/page.tsx | 14 +---- app/home/page.tsx | 16 +----- app/how_work/page.tsx | 11 +--- app/layout.tsx | 32 +++-------- app/prices/page.tsx | 11 +--- src/hooks/useCurrentUser.ts | 34 +++++++++++ src/services/user.service.ts | 17 +++++- src/types/user.ts | 6 ++ 15 files changed, 182 insertions(+), 84 deletions(-) create mode 100644 app/components/layout/ConditionalNavbar.tsx create mode 100644 app/components/layout/Footer.tsx create mode 100644 app/components/layout/index.ts create mode 100644 app/dashboard/profile/page.tsx create mode 100644 src/hooks/useCurrentUser.ts diff --git a/app/components/layout/ConditionalNavbar.tsx b/app/components/layout/ConditionalNavbar.tsx new file mode 100644 index 0000000..e23fa77 --- /dev/null +++ b/app/components/layout/ConditionalNavbar.tsx @@ -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 ; +} \ No newline at end of file diff --git a/app/components/layout/Footer.tsx b/app/components/layout/Footer.tsx new file mode 100644 index 0000000..8f43a95 --- /dev/null +++ b/app/components/layout/Footer.tsx @@ -0,0 +1,13 @@ +import Logo from "@/src/utils/logo"; + +export function Footer() { + return ( +
+
+ +
+ © 2026 Slash.sa. جميع الحقوق محفوظة. +
+
+
) +} \ No newline at end of file diff --git a/app/components/layout/Sidebar.tsx b/app/components/layout/Sidebar.tsx index 585ad3d..fb4d485 100644 --- a/app/components/layout/Sidebar.tsx +++ b/app/components/layout/Sidebar.tsx @@ -176,6 +176,7 @@ export function Sidebar() { flexShrink: 0, minHeight: "100vh", padding: "20px 12px", + }} > - {/* عنوان الصفحة */}

لوحة التحكم @@ -38,15 +37,21 @@ export function Topbar() {

- {/* أكشنز */}
- - {/* زرار المنيو — sm فقط، globals.css بتتحكم في الـ display */}
setOpen(true)} />
- {/* الدور */} + {/* زرار "حسابي" — بيروح لصفحة البروفايل، مع hover بيغير اللون ويعمل scale بسيط */} +