Created
November 7, 2017 10:27
-
-
Save michaldudek/2003e7538564421e2ec0cbb26a5f4aed to your computer and use it in GitHub Desktop.
iPhone X
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
/* | |
* Various constants used throughout the app. | |
*/ | |
import { | |
Dimensions, | |
Platform | |
} from 'react-native' | |
const { | |
width, | |
height | |
} = Dimensions.get('window') | |
// Platform detection | |
export const IPHONE = Platform.OS === 'ios' | |
export const IPHONE_X = IPHONE && height === 812 && width === 375 | |
export const ANDROID = !IPHONE | |
// Common components dimensions | |
export const NAVBAR_HEIGHT = (IPHONE) ? (IPHONE_X ? 97 : 64) : 70 | |
export const HOME_INDICATOR = (IPHONE_X) ? 34 : 0 | |
export const SEARCH_BAR_HEIGHT = 44 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment