Open History to see the last commit
1// Kept free of react-native / react-navigation imports so they stay unit-testable in node (those
2// packages ship untranspiled Flow syntax).
3
4export type NativeTopScrollEdgeEffect = "automatic" | "soft";
5export type NativeHeaderScrollEdgeEffects = {
6 readonly top: NativeTopScrollEdgeEffect;
7 readonly bottom: "hidden";
8 readonly left: "hidden";
9 readonly right: "hidden";
10};
11
12export function nativeTopScrollEdgeEffect(
13 os: string,
14 _version: number | string,
15): NativeTopScrollEdgeEffect {
16 if (os !== "ios") {
17 return "automatic";
18 }
19
20 // Forcing `soft` on iOS 27 makes production look like a local overlay instead of sampling the
21 // app content edge-to-edge.
22 return "automatic";
23}
24
25export function nativeHeaderScrollEdgeEffects(
26 os: string,
27 version: number | string,
28): NativeHeaderScrollEdgeEffects {
29 return {
30 top: nativeTopScrollEdgeEffect(os, version),
31 bottom: "hidden",
32 left: "hidden",
33 right: "hidden",
34 };
35}