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

react-native-lightbox

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-lightbox - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

29

index.js

@@ -21,2 +21,5 @@ /**

var cloneWithProps = require('react-tools/src/utils/cloneWithProps');
var onlyChild = require('react-tools/src/utils/onlyChild');
var Overlay = require('react-native-overlay');

@@ -31,2 +34,3 @@

propTypes: {
activeProps: PropTypes.object,
header: PropTypes.element,

@@ -36,5 +40,7 @@ underlayColor: PropTypes.string,

onClose: PropTypes.func,
swipeToDismiss: PropTypes.bool,
},
getDefaultProps: function() {
return {
swipeToDismiss: true,
onOpen: () => {},

@@ -168,4 +174,8 @@ onClose: () => {},

render: function() {
var { header } = this.props;
var {
header,
swipeToDismiss,
} = this.props;
var {
isOpen,

@@ -190,2 +200,7 @@ isPanning,

var handlers;
if(swipeToDismiss) {
handlers = this._panResponder.panHandlers;
}
var dragStyle;

@@ -214,2 +229,10 @@ if(isPanning) {

var overlayContent = this.props.children;
if(this.props.activeProps) {
overlayContent = cloneWithProps(
onlyChild(overlayContent),
this.props.activeProps
);
}
return (

@@ -230,4 +253,4 @@ <View

<Animated.View style={[styles.background, lightboxOpacityStyle]}></Animated.View>
<Animated.View style={[openStyle, dragStyle]} {...this._panResponder.panHandlers}>
{this.props.children}
<Animated.View style={[openStyle, dragStyle]} {...handlers}>
{overlayContent}
</Animated.View>

@@ -234,0 +257,0 @@ <Animated.View style={[styles.header, lightboxOpacityStyle]}>

7

package.json
{
"name": "react-native-lightbox",
"version": "0.1.1",
"description": "Full screen lightbox popups for React Native",
"version": "0.2.0",
"description": "Images etc in Full Screen Lightbox Popovers for React Native",
"main": "index.js",

@@ -34,4 +34,5 @@ "scripts": {

"dependencies": {
"react-native-overlay": "^0.2.8"
"react-native-overlay": "^0.2.8",
"react-tools": "^0.13.3"
}
}

@@ -49,2 +49,3 @@ # react-native-lightbox

|---|---|---|
|**`activeProps`**|`object`|Optional set of props applied to the content component when in lightbox mode. Usable for applying custom styles or higher resolution image source.|
|**`header`**|`element`|Custom header instead of default with X button|

@@ -54,2 +55,3 @@ |**`onClose`**|`function`|Triggered when lightbox is closed|

|**`underlayColor`**|`string`|Color of touchable background, defaults to `black`|
|**`swipeToDismiss`**|`bool`|Enables gestures to dismiss the fullscreen mode by swiping up or down, defaults to `true`.|

@@ -56,0 +58,0 @@ ## Demo

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