Skip to content

Instantly share code, notes, and snippets.

@brunobar79
Created March 9, 2016 18:45
Show Gist options
  • Select an option

  • Save brunobar79/f04c6f33f33f1437e4a8 to your computer and use it in GitHub Desktop.

Select an option

Save brunobar79/f04c6f33f33f1437e4a8 to your computer and use it in GitHub Desktop.
Dimensions Helper
'use strict';
import React from 'react-native';
const {
Dimensions
} = React;
export default class DimensionsHelper{
static isIpad() {
if(Dimensions.get('window').width >= 700){
return true;
}
return false;
}
static isIphone5() {
if(Dimensions.get('window').width == 320){
return true;
}
return false;
}
static isIphone5S() {
if(Dimensions.get('window').width == 320){
return true;
}
return false;
}
static isIphone6() {
if(Dimensions.get('window').width == 375){
return true;
}
return false;
}
static isIphone6Plus() {
if(Dimensions.get('window').width == 414){
return true;
}
return false;
}
static isIphone6SPlus() {
if(Dimensions.get('window').width == 414){
return true;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment