@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, 03:37 UTC

main
ts 29 lines 1.03 KB
Raw
1 type NativeGlassHeaderItem = {
2 readonly type: "button" | "menu";
3 readonly glassEffect?: boolean;
4 readonly hidesSharedBackground?: boolean;
5 readonly sharesBackground?: boolean;
6 readonly variant?: "plain" | "done" | "prominent";
7 readonly axisBehavior?: "automatic" | "horizontalOnly" | "verticalPreferred";
8 readonly width?: number;
9 };
10
11 /** Normal glassEffect items become custom UIButtons in react-native-screens, creating a second skinny capsule. */
12 export function withNativeGlassHeaderItem<T extends NativeGlassHeaderItem>(
13 item: T,
14 options: {
15 readonly hidesSharedBackground?: boolean;
16 readonly sharesBackground?: boolean;
17 readonly width?: number;
18 } = {},
19 ): T {
20 const sharesBackground = options.sharesBackground ?? item.sharesBackground ?? true;
21 return {
22 ...item,
23 glassEffect: item.glassEffect ?? false,
24 hidesSharedBackground: options.hidesSharedBackground ?? item.hidesSharedBackground ?? false,
25 sharesBackground,
26 variant: item.variant ?? "plain",
27 width: options.width ?? item.width,
28 } as T;
29 }