diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..74f938d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "i18n-ally-next.localesPaths": ["app/i18n"] +} diff --git a/app/ClientLayout.js b/app/ClientLayout.js index 446cecc..cb54fb7 100644 --- a/app/ClientLayout.js +++ b/app/ClientLayout.js @@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next"; import Link from "next/link"; import Image from "next/image"; import { NavLink, MobileNavLink } from "./components/NavLinks"; -import BottomNav from './components/BottomNav'; +import BottomNav from "./components/BottomNav"; import { Globe, LogIn, @@ -16,25 +16,16 @@ import { Building, PlusCircle, Heart, - MessageCircle, Settings, - Edit, Phone, Mail, - MapPin, - Camera, Bell, - Home, - ChevronDown, Menu, X, TrendingUp, CalendarDays, - Clock, DollarSign, Star, - Moon, - Sun, FileText, } from "lucide-react"; import { useState, useEffect, useRef } from "react"; @@ -43,8 +34,9 @@ import AuthService from "./services/AuthService"; import { UserRole, UserRoleLabels } from "./enums/UserRole"; import "./i18n/config"; import NotificationHandler from "./components/NotificationHandler"; -import { useTheme } from '@/app/contexts/ThemeContext'; -import { useNotifications } from '@/app/contexts/NotificationsContext'; + +import { useNotifications } from "@/app/contexts/NotificationsContext"; +import Loading from "./loading"; export default function ClientLayout({ children }) { const { t, i18n } = useTranslation(); @@ -56,7 +48,7 @@ export default function ClientLayout({ children }) { const [isMounted, setIsMounted] = useState(false); const currentYear = new Date().getFullYear(); const menuRef = useRef(null); - const { theme, toggleTheme } = useTheme(); + const { unreadCount } = useNotifications(); useEffect(() => { @@ -128,13 +120,7 @@ export default function ClientLayout({ children }) { window.location.href = "/"; }; - const isAuthPage = [ - "/login", - "/blocked", - "/register", - "/forgot-password", - "/auth/choose-role", - ].includes(pathname); + const isAuthPage = ["/login", "/blocked", "/register", "/forgot-password", "/auth/choose-role"].includes(pathname); const isProfilePage = pathname === "/profile"; const isHomePage = pathname === "/"; @@ -154,64 +140,52 @@ export default function ClientLayout({ children }) { if (!isMounted) { return ( -
-
-
-

{t("loading")}

-
-
+ ); } return (
{!isAuthPage && !isAuthenticated && ( -