UNPKG

react-native-unit-components

Version:

Unit React Native components

24 lines (22 loc) 2.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.statusBarHeight = exports.overFullScreenHeight = exports.isAndroid10AndAbove = exports.iosStatusBarHeight = exports.fullScreenHeight = exports.androidStatusBarHeight = exports.VERTICAL_PADDING = exports.TOP_PADDING = exports.RIGHT_PADDING = exports.LEFT_PADDING = exports.BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE = exports.BOTTOM_PADDING = 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; const TOP_PADDING = exports.TOP_PADDING = 48; const BOTTOM_PADDING = exports.BOTTOM_PADDING = 24; const LEFT_PADDING = exports.LEFT_PADDING = 24; const RIGHT_PADDING = exports.RIGHT_PADDING = 24; const VERTICAL_PADDING = exports.VERTICAL_PADDING = TOP_PADDING + BOTTOM_PADDING; // For adjusting injected height //# sourceMappingURL=UNBottomSheetComponent.constants.js.map