react-native-region-picker-modal
Version:
19 lines (13 loc) • 437 B
JavaScript
// @flow
import { Dimensions, Platform } from 'react-native'
const { height } = Dimensions.get('window')
// Remove the status bar height
// since the modal view does not cover this area
const ANDROID_MINUS_HEIGHT = 24
const DEFAULT_HEIGHT =
Platform.OS === 'android' ? height - ANDROID_MINUS_HEIGHT : height
export const getHeightPercent = percentage =>
DEFAULT_HEIGHT * (percentage / 100)
export default {
getHeightPercent
}