UNPKG

548 BTypeScriptView Raw
1import { NativeModules, Platform } from 'react-native';
2
3// Use the existence of expo-constants as a heuristic for determining if the
4// status bar is translucent on Android. This should be replaced in the future
5// with react-native-safe-area-context.
6const estimatedStatusBarHeight =
7 NativeModules.NativeUnimoduleProxy?.modulesConstants?.ExponentConstants
8 ?.statusBarHeight ?? 0;
9
10export const APPROX_STATUSBAR_HEIGHT = Platform.select({
11 android: estimatedStatusBarHeight,
12 ios: Platform.Version < 11 ? estimatedStatusBarHeight : 0,
13});