From 7a70a2fb9f90f7067d2e86c8d8d710eadf42e097 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Fri, 17 Oct 2025 22:58:37 +0200 Subject: [PATCH] feat: update ClientLayout to hide header and sidebar on public routes and book reader paths for improved navigation --- src/app/books/[bookId]/layout.tsx | 8 ++++++++ src/components/layout/ClientLayout.tsx | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/app/books/[bookId]/layout.tsx diff --git a/src/app/books/[bookId]/layout.tsx b/src/app/books/[bookId]/layout.tsx new file mode 100644 index 0000000..3b85f52 --- /dev/null +++ b/src/app/books/[bookId]/layout.tsx @@ -0,0 +1,8 @@ +export default function BookReaderLayout({ + children, +}: { + children: React.ReactNode; +}) { + return <>{children}; +} + diff --git a/src/components/layout/ClientLayout.tsx b/src/components/layout/ClientLayout.tsx index 7591c4a..377cff4 100644 --- a/src/components/layout/ClientLayout.tsx +++ b/src/components/layout/ClientLayout.tsx @@ -89,8 +89,8 @@ export default function ClientLayout({ children, initialLibraries = [], initialF registerServiceWorker(); }, []); - // Ne pas afficher le header et la sidebar sur les routes publiques - const isPublicRoute = publicRoutes.includes(pathname); + // Ne pas afficher le header et la sidebar sur les routes publiques et le reader + const isPublicRoute = publicRoutes.includes(pathname) || pathname.startsWith('/books/'); return (