Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

glass-header-options.ts

26 lines1.2 KB

1import type { NativeStackNavigationOptions } from "@react-navigation/native-stack";
2import { Platform } from "react-native";
3​
4import { NATIVE_LIQUID_GLASS_SUPPORTED } from "./native-glass";
5import { nativeHeaderScrollEdgeEffects } from "./scrollEdgeEffects";
6​
7export type AppScreenOptions = NativeStackNavigationOptions & {
8 readonly unstable_navigationItemStyle?: "editor";
9 readonly unstable_headerMinimizationBehavior?: "onScrollUp" | "never";
10};
11​
12/** A transparent bar that content scrolls under, with UIKit's scroll-edge blur where it has one. */
13export const GLASS_HEADER_OPTIONS: AppScreenOptions = {
14 headerBackButtonDisplayMode: "minimal",
15 headerBackTitle: "",
16 headerLargeTitle: false,
17 headerShadowVisible: false,
18 headerShown: true,
19 headerStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? { backgroundColor: "transparent" } : undefined,
20 headerTitleStyle: { fontSize: 18, fontWeight: "800" },
21 headerTransparent: NATIVE_LIQUID_GLASS_SUPPORTED,
22 scrollEdgeEffects: NATIVE_LIQUID_GLASS_SUPPORTED
23 ? nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version)
24 : undefined,
25 unstable_navigationItemStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? "editor" : undefined,
26};