mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 16:13:15 +00:00
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.
20 lines
812 B
TypeScript
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;
|
|
}
|