Compare commits

...

2 Commits

Author SHA1 Message Date
6bc0c8ba27 Merge branch 'main' of http://45.93.137.91:3000/Rahaf/SweetHome
All checks were successful
Build frontend / build (push) Successful in 1m31s
2026-06-04 23:33:25 +03:00
9fdeadaa61 Added bottom navbar 2026-06-04 22:54:34 +03:00
2 changed files with 71 additions and 11 deletions

View File

@ -7,7 +7,7 @@ import Image from "next/image";
import { NavLink, MobileNavLink } from "./components/NavLinks";
import { FavoritesProvider } from '@/app/contexts/FavoritesContext';
import { NotificationsProvider } from '@/app/contexts/NotificationsContext';
import FloatingSidebar from '@/app/components/FloatingSidebar';
import BottomNav from './components/BottomNav';
import {
Globe,
LogIn,
@ -162,7 +162,7 @@ export default function ClientLayout({ children }) {
return (
<>
{!isAuthPage && (
{!isAuthPage && !isAuthenticated && (
<nav className="fixed top-0 left-0 right-0 bg-white/95 backdrop-blur-sm border-b border-gray-200 z-50 transition-all duration-300 shadow-sm">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div
@ -806,16 +806,19 @@ export default function ClientLayout({ children }) {
</nav>
)}
<main
className={`${!isAuthPage && !isProfilePage ? "pt-20" : ""} min-h-screen bg-gradient-to-b from-gray-50 to-white ${currentLanguage === "ar" ? "text-right" : "text-left"}`}
>
<NotificationsProvider>
<FavoritesProvider>
<NotificationsProvider>
<FavoritesProvider>
<main
className={`${!isAuthPage && !isProfilePage && !isAuthenticated ? "pt-20" : ""} min-h-screen bg-gradient-to-b from-gray-50 to-white ${currentLanguage === "ar" ? "text-right" : "text-left"}`}
>
{children}
<FloatingSidebar isRTL={currentLanguage === 'ar'} isAdmin={isAdmin} />
</FavoritesProvider>
</NotificationsProvider>
</main>
</main>
{isAuthenticated && !isAuthPage && (
<BottomNav isOwner={isOwner} />
)}
</FavoritesProvider>
</NotificationsProvider>
{!isAuthPage && !isProfilePage && (
<footer className="bg-gray-900 text-white py-12">

View File

@ -0,0 +1,57 @@
"use client";
import Link from "next/link";
import { Home, Building, Calendar, Heart, Bell, Settings } from "lucide-react";
import React, { useEffect, useState } from "react";
import { useNotifications } from "@/app/contexts/NotificationsContext";
export default function BottomNav({ isOwner }) {
const { unreadCount } = useNotifications();
const [isMounted, setIsMounted] = useState(false);
const bookingsHref = isOwner ? "/owner/reservations" : "/reservations";
useEffect(() => {
setIsMounted(true);
}, []);
const items = [
{ href: "/", label: "الرئيسية", icon: Home },
{ href: "/properties", label: "عقاراتنا", icon: Building },
{ href: bookingsHref, label: "الحجوزات", icon: Calendar },
{ href: "/favorites", label: "المفضلة", icon: Heart },
{ href: "/notifications", label: "الإشعارات", icon: Bell, badge: isMounted ? unreadCount : 0 },
{ href: "/settings", label: "الإعدادات", icon: Settings },
];
return (
<nav className="fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50">
<div className="bg-white/95 backdrop-blur-sm border border-gray-200 rounded-3xl shadow-lg px-2 py-2 flex items-center gap-3">
{items.map((it) => {
const Icon = it.icon;
return (
<Link
key={it.href}
href={it.href}
className="relative group flex flex-col items-center justify-center px-2.5 py-2 text-gray-700 hover:text-amber-600 transition-colors"
>
<div className="relative">
<Icon className="w-6 h-6" />
{it.badge > 0 && (
<div className="absolute -top-2 -right-2 bg-red-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center">
{it.badge > 9 ? "9+" : it.badge}
</div>
)}
</div>
<div className="absolute -top-10 left-1/2 -translate-x-1/2 bg-gray-800 text-white text-xs rounded-lg px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none shadow-lg">
{it.label}
</div>
<div className="mt-1 text-xs text-center" aria-hidden>
{it.label}
</div>
</Link>
);
})}
</div>
</nav>
);
}