UNPKG

react-native-unit-components

Version:

Unit React Native components

19 lines (17 loc) 1.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.statusBarHeight = exports.overFullScreenHeight = exports.isAndroid10AndAbove = exports.iosStatusBarHeight = exports.fullScreenHeight = exports.androidStatusBarHeight = exports.BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE = void 0; var _reactNative = require("react-native"); const BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE = exports.BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE = 0.9; const androidStatusBarHeight = exports.androidStatusBarHeight = _reactNative.StatusBar.currentHeight || 0; // For iOS - we are currently using hard coded height const iosStatusBarHeight = exports.iosStatusBarHeight = _reactNative.Dimensions.get('window').height * 0.05; const statusBarHeight = exports.statusBarHeight = _reactNative.Platform.OS === 'android' ? androidStatusBarHeight : iosStatusBarHeight; // Android 10 and above - need to add status bar height to the window height to get the full screen height because Dimensions.get('window').height returns the height without the status bar // reference: https://github.com/facebook/react-native/issues/23693#issuecomment-1403560728 const isAndroid10AndAbove = exports.isAndroid10AndAbove = _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 29; const fullScreenHeight = exports.fullScreenHeight = isAndroid10AndAbove ? _reactNative.Dimensions.get('window').height + statusBarHeight : _reactNative.Dimensions.get('window').height; const overFullScreenHeight = exports.overFullScreenHeight = _reactNative.Dimensions.get('window').height * BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE; //# sourceMappingURL=UNBottomSheetComponent.constants.js.map