Created
March 9, 2016 18:45
-
-
Save brunobar79/f04c6f33f33f1437e4a8 to your computer and use it in GitHub Desktop.
Dimensions Helper
This file contains hidden or 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
| '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