From 6511ed02cbdb6c71f3712387036a81be2734bc9a Mon Sep 17 00:00:00 2001 From: Froidefond Julien Date: Mon, 30 Mar 2026 09:24:44 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20d=C3=A9placer=20le=20bouton=20logout=20?= =?UTF-8?q?dans=20le=20menu=20hamburger=20mobile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sur mobile, le bouton logout est désormais dans le drawer MobileNav (en bas, après Settings) et masqué dans le header. Co-Authored-By: Claude Sonnet 4.6 --- apps/backoffice/app/(app)/layout.tsx | 4 +++- apps/backoffice/app/components/MobileNav.tsx | 19 +++++++++++++++++++ apps/backoffice/lib/i18n/en.ts | 3 +++ apps/backoffice/lib/i18n/fr.ts | 3 +++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/backoffice/app/(app)/layout.tsx b/apps/backoffice/app/(app)/layout.tsx index 7079910..3647508 100644 --- a/apps/backoffice/app/(app)/layout.tsx +++ b/apps/backoffice/app/(app)/layout.tsx @@ -93,7 +93,9 @@ export default async function AppLayout({ children }: { children: ReactNode }) { - +
+ +
Promise; }) { const { t } = useTranslation(); + const router = useRouter(); const [isOpen, setIsOpen] = useState(false); const [mounted, setMounted] = useState(false); const [, startTransition] = useTransition(); + async function handleLogout() { + await fetch("/api/auth/logout", { method: "POST" }); + router.push("/login"); + router.refresh(); + } + function select(userId: string | null) { startTransition(async () => { const fd = new FormData(); @@ -128,6 +136,17 @@ export function MobileNav({ navItems, users, activeUserId, setActiveUserAction } {t("nav.settings")} + diff --git a/apps/backoffice/lib/i18n/en.ts b/apps/backoffice/lib/i18n/en.ts index 414ea32..40d03a4 100644 --- a/apps/backoffice/lib/i18n/en.ts +++ b/apps/backoffice/lib/i18n/en.ts @@ -1,6 +1,9 @@ import type { TranslationKey } from "./fr"; const en: Record = { + // Auth + "auth.logout": "Log out", + // Navigation "nav.dashboard": "Dashboard", "nav.books": "Books", diff --git a/apps/backoffice/lib/i18n/fr.ts b/apps/backoffice/lib/i18n/fr.ts index f455473..08f1c6b 100644 --- a/apps/backoffice/lib/i18n/fr.ts +++ b/apps/backoffice/lib/i18n/fr.ts @@ -1,4 +1,7 @@ const fr = { + // Auth + "auth.logout": "Se déconnecter", + // Navigation "nav.dashboard": "Tableau de bord", "nav.books": "Livres",