Created
November 15, 2017 21:25
-
-
Save rgommezz/a82986b05557f2dd89ebb087d43fb808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dimensions } from 'react-native'; | |
// See https://mydevice.io/devices/ for device dimensions | |
const X_WIDTH = 375; | |
const X_HEIGHT = 812; | |
export const isIPhoneX = () => { | |
const { height: D_HEIGHT, width: D_WIDTH } = Dimensions.get('window'); | |
return Platform.OS === 'ios' && | |
((D_HEIGHT === X_HEIGHT && D_WIDTH === X_WIDTH) || | |
(D_HEIGHT === X_WIDTH && D_WIDTH === X_HEIGHT)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment