From cdff23c65b2db8b0ff24a2d37192fb996a7fa84c Mon Sep 17 00:00:00 2001 From: alma Date: Tue, 20 Jan 2026 23:12:56 +0100 Subject: [PATCH] agenda finition --- components/layout/layout-wrapper.tsx | 35 ++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/components/layout/layout-wrapper.tsx b/components/layout/layout-wrapper.tsx index 5b0f99a..b8213ee 100644 --- a/components/layout/layout-wrapper.tsx +++ b/components/layout/layout-wrapper.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useSession, signOut } from "next-auth/react"; import { usePathname } from "next/navigation"; import { MainNav } from "@/components/main-nav"; @@ -28,12 +28,18 @@ export function LayoutWrapper({ children, isSignInPage, isAuthenticated }: Layou const { currentBackground, changeBackground } = useBackgroundImage(); const { data: session } = useSession(); const pathname = usePathname(); - const isAgendaPage = pathname?.startsWith('/agenda') || pathname === '/agenda'; + const [isAgendaPage, setIsAgendaPage] = useState(false); - // Debug: log pour vérifier le pathname + // Détection robuste de la page agenda avec fallback window.location useEffect(() => { - console.log('[LayoutWrapper] pathname:', pathname, 'isAgendaPage:', isAgendaPage); - }, [pathname, isAgendaPage]); + const checkAgendaPage = () => { + const currentPath = pathname || (typeof window !== 'undefined' ? window.location.pathname : ''); + const isAgenda = currentPath?.startsWith('/agenda') || currentPath === '/agenda'; + setIsAgendaPage(isAgenda); + console.log('[LayoutWrapper] pathname:', currentPath, 'isAgendaPage:', isAgenda); + }; + checkAgendaPage(); + }, [pathname]); // Listen for incoming RocketChat calls via WebSocket const { incomingCall, setIncomingCall } = useRocketChatCalls(); @@ -216,16 +222,26 @@ export function LayoutWrapper({ children, isSignInPage, isAuthenticated }: Layou }; }, [isSignInPage, session]); + // Force background blanc sur body pour la page agenda + useEffect(() => { + if (isAgendaPage && typeof document !== 'undefined') { + document.body.style.backgroundColor = 'white'; + return () => { + document.body.style.backgroundColor = ''; + }; + } + }, [isAgendaPage]); + return ( {!isSignInPage && isAuthenticated && }
{children}
- {/* TEMPORAIRE : Footer masqué uniquement sur la page agenda pour test layout */} - {/* Force masquage pour test - pathname: ${pathname}, isAgendaPage: ${isAgendaPage} */} - {!isSignInPage && isAuthenticated && !isAgendaPage && pathname !== '/agenda' &&