react-native-device
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,7 @@ | ||
1.0.1 | ||
----- | ||
Fix incorrect import of the Dimensions module [#20](https://github.com/GertjanReynaert/react-native-device/pull/20) | ||
Thx @RWOverdijk for this fix | ||
1.0.0 | ||
@@ -2,0 +8,0 @@ ----- |
@@ -1,11 +0,8 @@ | ||
var { NativeModules } = require('react-native'); | ||
var { NativeModules, Dimensions } = require('react-native'); | ||
var DeviceUtil = NativeModules.DeviceUtil; | ||
var Dimensions = require('Dimensions'); | ||
class Device { | ||
constructor() { | ||
this.width = Dimensions.get("window").width; | ||
this.height = Dimensions.get("window").height; | ||
this.width = Dimensions.get('window').width; | ||
this.height = Dimensions.get('window').height; | ||
this.model = DeviceUtil.model; | ||
@@ -18,15 +15,10 @@ this.deviceName = DeviceUtil.name; | ||
isIpad() { | ||
if (this.model.indexOf("iPad") >= 0) { | ||
return true; | ||
} | ||
return this.model.indexOf('iPad') >= 0; | ||
} | ||
isIphone() { | ||
if (this.model.indexOf("iPhone") >= 0) { | ||
return true; | ||
} | ||
return this.model.indexOf('iPhone') >= 0; | ||
} | ||
} | ||
module.exports = new Device(); | ||
module.exports = new Device(); |
{ | ||
"name": "react-native-device", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "UIDevice wrapper for React Native", | ||
@@ -5,0 +5,0 @@ "main": "Device.js", |
@@ -1,7 +0,9 @@ | ||
# UIDevice Wrapper for React Native | ||
# React Native Device | ||
A wrapper for the native [UIDevice](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/cl/UIDevice) class allowing you to access device properties and screen dimensions. | ||
 | ||
## Installation | ||
A wrapper for the native [iOS UIDevice](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/cl/UIDevice) & [Android Build](http://developer.android.com/reference/android/os/Build.html) class allowing you to access device properties and screen dimensions. **Currently only for React Native iOS, [Android support](https://github.com/GertjanReynaert/react-native-device/issues/16) in progress.** | ||
## Installation (iOS) | ||
First install the package to your project from NPM... | ||
@@ -59,3 +61,3 @@ | ||
``` | ||
```javascript | ||
'use strict'; | ||
@@ -62,0 +64,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3792
76
19