Files
webmail/hooks/use-mountain-view-shell.ts
lucamzanon 19e06d02ad fix(mountain-view): keep the same top bar on every app
Calendar, contacts, files and settings still drew the left navigation
rail under Mountain View, so moving away from mail switched to the
default frame. They now show the Mountain View top bar too, without the
mail search and the menu button, which only make sense in mail.
2026-10-09 08:27:01 +02:00

20 lines
812 B
TypeScript

"use client";
import { useIsDesktop } from "@/hooks/use-media-query";
import { useSettingsStore } from "@/stores/settings-store";
/**
* Whether a surface draws Mountain View's desktop chrome: the top bar with the
* app grid and the account avatar, in place of the left navigation rail.
*
* Mail, calendar, contacts, files and settings all ask the same question, so
* moving between them under Mountain View keeps the same frame. Phones and
* tablets keep their own navigation, and so does a surface embedded in a Pro
* pane, whose shell owns the chrome.
*/
export function useMountainViewShell(isEmbedded: boolean): boolean {
const mountainView = useSettingsStore((s) => s.interfaceLayout === "mountain-view");
const isDesktop = useIsDesktop();
return mountainView && isDesktop && !isEmbedded;
}