Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-device

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-device - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

CHANGELOG.md

@@ -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 @@ -----

20

Device.js

@@ -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.
![NPM Stats](https://nodei.co/npm/react-native-device.png?downloads=true)
## 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc