Skip to content

Instantly share code, notes, and snippets.

@michaldudek
Created November 7, 2017 10:27
Show Gist options
  • Save michaldudek/2003e7538564421e2ec0cbb26a5f4aed to your computer and use it in GitHub Desktop.
Save michaldudek/2003e7538564421e2ec0cbb26a5f4aed to your computer and use it in GitHub Desktop.
iPhone X
/*
* 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