Socket
Socket
Sign inDemoInstall

react-native-modal

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-modal - npm Package Compare versions

Comparing version 2.5.0 to 3.0.0

ISSUE_TEMPLATE.md

3

package.json
{
"name": "react-native-modal",
"version": "2.5.0",
"version": "3.0.0",
"description": "An enhanced React-Native modal",
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {

@@ -7,0 +8,0 @@ "lint": "eslint src",

@@ -77,2 +77,3 @@ # react-native-modal

| onBackButtonPress | func | () => null | Called when the Android back button is pressed |
| onBackdropPress | func | () => null | Called when the backdrop is pressed |
| isVisible | bool | **REQUIRED** | Show the modal? |

@@ -89,2 +90,2 @@ | children | node | **REQUIRED** | The modal content |

P.S.: Thanks [@oblador](https://github.com/oblador) for react-native-animatable and [@brentvatne](https://github.com/brentvatne) for the npm namespace!
P.S.: Thanks [@oblador](https://github.com/oblador) for react-native-animatable, [@brentvatne](https://github.com/brentvatne) for the npm namespace and to anyone who contributed to this library!
import React, { Component } from 'react';
import { Dimensions, Modal, DeviceEventEmitter } from 'react-native';
import { Dimensions, Modal, DeviceEventEmitter, TouchableWithoutFeedback } from 'react-native';
import PropTypes from 'prop-types';

@@ -27,3 +27,5 @@ import { View, initializeRegistryWithDefinitions } from 'react-native-animatable';

hideOnBack: PropTypes.bool,
hideOnBackdropPress: PropTypes.bool,
onBackButtonPress: PropTypes.func,
onBackdropPress: PropTypes.func,
style: PropTypes.any,

@@ -45,2 +47,4 @@ };

hideOnBack: true,
hideOnBackdropPress: true,
onBackdropPress: () => null,
onBackButtonPress: () => null,

@@ -124,2 +128,9 @@ };

_closeOnBackdrop = () => {
if (this.props.hideOnBackdropPress) {
this._close()
}
this.props.onBackdropPress()
}
render() {

@@ -151,12 +162,19 @@ const {

>
<TouchableWithoutFeedback onPress={this._closeOnBackdrop}>
<View
ref={ref => (this.backdropRef = ref)}
style={[
styles.backdrop,
{
backgroundColor: backdropColor,
width: deviceWidth,
height: deviceHeight,
},
]}
/>
</TouchableWithoutFeedback>
<View
ref={ref => (this.backdropRef = ref)}
style={[
styles.backdrop,
{ backgroundColor: backdropColor, width: deviceWidth, height: deviceHeight },
]}
/>
<View
ref={ref => (this.contentRef = ref)}
style={[{ margin: deviceWidth * 0.05 }, styles.content, style]}
style={[{ margin: deviceWidth * 0.05, transform: [{translateY: 0}] }, styles.content, style]}
pointerEvents="box-none"
{...otherProps}

@@ -163,0 +181,0 @@ >

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