@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 21 lines 882 Bytes
Raw
1 import { useWindowDimensions } from "react-native";
2 import { useSafeAreaInsets } from "react-native-safe-area-context";
3
4 import { useScaledTextRole } from "../../features/settings/appearance/useScaledTextRole";
5 import { useAndroidControlSizing } from "./useAndroidControlSizing";
6
7 /** Shared Android header geometry; class-based spacing uses the app's 14dp rem. */
8 export function useToolbarLayout(embedded = false) {
9 const insets = useSafeAreaInsets();
10 const title = useScaledTextRole("title");
11 const subtitle = useScaledTextRole("label");
12 const { scale } = useAndroidControlSizing();
13 const { fontScale } = useWindowDimensions();
14 return {
15 height: Math.ceil(
16 Math.max(48, 56 * scale, (title.lineHeight + subtitle.lineHeight) * fontScale + 1),
17 ),
18 paddingTop: embedded ? 8 * scale : Math.max(insets.top, 12 * scale),
19 paddingBottom: 7 * scale,
20 };
21 }