Open History to see the last commit
1import type { HeaderBarButtonMailSearchToolbarItem } from "react-native-screens";
2
3import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
4
5/**
6 * The patched mail-style toolbar is built natively from iOS 26 Liquid Glass
7 * UIKit (`UIGlassEffect`) with no earlier fallback: pre-26 the native side
8 * silently drops the item and hides the navigation toolbar entirely. Screens
9 * that send it must fall back to standard search/toolbar primitives when this
10 * is false.
11 */
12export const NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED = NATIVE_LIQUID_GLASS_SUPPORTED;
13
14/** Clearance for scroll content that must come to rest above the floating toolbar. */
15export const NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET = 56;
16
17type NativeMailSearchToolbarInput = Omit<
18 HeaderBarButtonMailSearchToolbarItem,
19 "type" | "useFallbackSearchField"
20>;
21
22/**
23 * Builds the patched react-native-screens Mail-style bottom search toolbar.
24 *
25 * Keeping this behind an app-level helper makes the iOS-only RNS patch an
26 * explicit layout primitive instead of a per-screen object literal. Android can
27 * keep using platform-specific header/search primitives without depending on
28 * this helper.
29 */
30export function createNativeMailSearchToolbarItem(
31 input: NativeMailSearchToolbarInput,
32): HeaderBarButtonMailSearchToolbarItem {
33 return {
34 placeholder: "Search",
35 ...input,
36 type: "mailSearchToolbar",
37 useFallbackSearchField: true,
38 };
39}