diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/statusBarHeight.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/utils/statusBarHeight.ts b/src/utils/statusBarHeight.ts index b8eb7b33..c5509376 100644 --- a/src/utils/statusBarHeight.ts +++ b/src/utils/statusBarHeight.ts @@ -1,15 +1,14 @@ import {Platform, StatusBar} from 'react-native'; import {SCREEN_HEIGHT, SCREEN_WIDTH} from './screenDimensions'; -const X_WIDTH = 375; -const X_HEIGHT = 812; -const XSMAX_WIDTH = 414; -const XSMAX_HEIGHT = 896; - +/** + * Working as of Q1 2021, latest iPhone is 12 + * iPhone 8/SE has a logical screen ratio of about 1.77 + * Rest has a logical screen ratio of about 2.16 + */ export const isIPhoneX = () => Platform.OS === 'ios' && !Platform.isPad && !Platform.isTVOS - ? (SCREEN_WIDTH === X_WIDTH && SCREEN_HEIGHT === X_HEIGHT) || - (SCREEN_WIDTH === XSMAX_WIDTH && SCREEN_HEIGHT === XSMAX_HEIGHT) + ? SCREEN_HEIGHT / SCREEN_WIDTH > 2 : false; // Taken from: https://github.com/react-navigation/react-navigation/issues/283 |