From 50d636a5777cd2e6c1349fdca3ffcd23aae6b2ba Mon Sep 17 00:00:00 2001 From: mouazkh Date: Mon, 25 May 2026 21:37:37 +0300 Subject: [PATCH] fixed my propries page and fixed the sidebar again mouaz is the best in the west --- app/components/FloatingSidebar.js | 6 ++++-- app/owner/properties/page.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/components/FloatingSidebar.js b/app/components/FloatingSidebar.js index ebfd503..4e30afc 100644 --- a/app/components/FloatingSidebar.js +++ b/app/components/FloatingSidebar.js @@ -6,6 +6,7 @@ import Link from 'next/link'; import { Heart, Bell, CreditCard, Shield, UserPlus, Settings, CalendarDays, Star, FileText } from 'lucide-react'; import { useFavorites } from '@/app/contexts/FavoritesContext'; import { useNotifications } from '@/app/contexts/NotificationsContext'; +import AuthService from '@/app/services/AuthService'; export default function FloatingSidebar({ isRTL, isAdmin }) { const { favorites } = useFavorites(); @@ -24,9 +25,10 @@ export default function FloatingSidebar({ isRTL, isAdmin }) { setTooltip(null); }; - const side = isRTL ? 'left' : 'right'; + if (!AuthService.isAuthenticated()) return null; + const positionStyle = { - [side]: 0, + left: '24px', top: '50%', transform: 'translateY(-50%)', }; diff --git a/app/owner/properties/page.js b/app/owner/properties/page.js index 625521c..b6fc349 100644 --- a/app/owner/properties/page.js +++ b/app/owner/properties/page.js @@ -727,8 +727,8 @@ export default function OwnerPropertiesPage() { getMySaleListings(), ]); - const rentList = rentData.status === 'fulfilled' ? (Array.isArray(rentData.value) ? rentData.value : (rentData.value ? [rentData.value] : [])) : []; - const saleList = saleData.status === 'fulfilled' ? (Array.isArray(saleData.value) ? saleData.value : (saleData.value ? [saleData.value] : [])) : []; + const rentList = rentData.status === 'fulfilled' ? (Array.isArray(rentData.value) ? rentData.value.filter(Boolean) : (rentData.value ? [rentData.value] : [])) : []; + const saleList = saleData.status === 'fulfilled' ? (Array.isArray(saleData.value) ? saleData.value.filter(Boolean) : (saleData.value ? [saleData.value] : [])) : []; console.log('[OwnerProperties] Rent:', rentList.length, 'Sale:', saleList.length);