Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react-photoswipe-2
Advanced tools
react photoswipe component base on Photoswipe. Support React >= 16.
Fork from https://github.com/minhtranite/react-photoswipe
Support React 16, PureComponent
Solved this issue https://github.com/minhtranite/react-photoswipe/issues/9
PhotoSwipe, PhotoSwipeGallery component for ReactJS base on PhotoSwipe.
View demo or example folder.
https://github.com/anhdn/react-photoswipe-2
npm install --save react-photoswipe
bower install --save react-photoswipe
import 'react-photoswipe/lib/photoswipe.css';
<link rel="stylesheet" type="text/css" href="path/to/react-photoswipe/lib/photoswipe.css">
import {PhotoSwipe} from 'react-photoswipe';
let isOpen = true;
let items = [
{
src: 'http://lorempixel.com/1200/900/sports/1',
w: 1200,
h: 900,
title: 'Image 1'
},
{
src: 'http://lorempixel.com/1200/900/sports/2',
w: 1200,
h: 900,
title: 'Image 2'
}
];
let options = {
//http://photoswipe.com/documentation/options.html
};
handleClose = () => {
isOpen: false
};
<PhotoSwipe isOpen={isOpen} items={items} options={options} onClose={handleClose}/>
import {PhotoSwipeGallery} from 'react-photoswipe';
let items = [
{
src: 'http://lorempixel.com/1200/900/sports/1',
thumbnail: 'http://lorempixel.com/120/90/sports/1',
w: 1200,
h: 900,
title: 'Image 1'
},
{
src: 'http://lorempixel.com/1200/900/sports/2',
thumbnail: 'http://lorempixel.com/120/90/sports/2',
w: 1200,
h: 900,
title: 'Image 2'
}
];
let options = {
//http://photoswipe.com/documentation/options.html
};
getThumbnailContent = (item) => {
return (
<img src={item.thumbnail} width={120} height={90}/>
);
}
<PhotoSwipeGallery items={items} options={options} thumbnailContent={getThumbnailContent}/>
<link rel="stylesheet" type="text/css" href="path/to/react-photoswipe/dist/photoswipe.css">
<script src="path/to/react-photoswipe/dist/react-photoswipe.js"></script>
var PhotoSwipe = window.ReactPhotoswipe.PhotoSwipe;
var PhotoSwipeGallery = window.ReactPhotoswipe.PhotoSwipeGallery;
Example here
Note: The first argument of every listener is a Photoswipe instance.
EX:
beforeChange(instance, change);
imageLoadComplete(instance, index, item);
Name | Type | Default | Required | Description |
---|---|---|---|---|
isOpen | bool | false | true | |
items | array | [] | true | http://photoswipe.com/documentation/getting-started.html |
options | object | {} | false | http://photoswipe.com/documentation/options.html |
onClose | function | false | Callback after PhotoSwipe close | |
id | string | false | ||
className | string | pswp | ||
beforeChange | function | false | Photoswipe event listener | |
afterChange | function | false | Photoswipe event listener | |
imageLoadComplete | function | false | Photoswipe event listener | |
resize | function | false | Photoswipe event listener | |
gettingData | function | false | Photoswipe event listener | |
mouseUsed | function | false | Photoswipe event listener | |
initialZoomIn | function | false | Photoswipe event listener | |
initialZoomInEnd | function | false | Photoswipe event listener | |
initialZoomOut | function | false | Photoswipe event listener | |
initialZoomOutEnd | function | false | Photoswipe event listener | |
parseVerticalMargin | function | false | Photoswipe event listener | |
close | function | false | Photoswipe event listener | |
unbindEvents | function | false | Photoswipe event listener | |
destroy | function | false | Photoswipe event listener | |
updateScrollOffset | function | false | Photoswipe event listener | |
preventDragEvent | function | false | Photoswipe event listener | |
shareLinkClick | function | false | Photoswipe event listener |
Name | Type | Default | Required | Description |
---|---|---|---|---|
items | array | [] | true | http://photoswipe.com/documentation/getting-started.html |
options | object | {} | false | http://photoswipe.com/documentation/options.html |
thumbnailContent | function | <img src={item.src} width='100' height='100'/> | false | Thumbnail content |
isOpen | bool | false | false | Use it with onClose prop |
onClose | function | false | Callback after close | |
id | string | false | ||
className | string | pswp-gallery | ||
beforeChange | function | false | Photoswipe event listener | |
afterChange | function | false | Photoswipe event listener | |
imageLoadComplete | function | false | Photoswipe event listener | |
resize | function | false | Photoswipe event listener | |
gettingData | function | false | Photoswipe event listener | |
mouseUsed | function | false | Photoswipe event listener | |
initialZoomIn | function | false | Photoswipe event listener | |
initialZoomInEnd | function | false | Photoswipe event listener | |
initialZoomOut | function | false | Photoswipe event listener | |
initialZoomOutEnd | function | false | Photoswipe event listener | |
parseVerticalMargin | function | false | Photoswipe event listener | |
close | function | false | Photoswipe event listener | |
unbindEvents | function | false | Photoswipe event listener | |
destroy | function | false | Photoswipe event listener | |
updateScrollOffset | function | false | Photoswipe event listener | |
preventDragEvent | function | false | Photoswipe event listener | |
shareLinkClick | function | false | Photoswipe event listener |
FAQs
react photoswipe component base on Photoswipe. Support React >= 16.
We found that react-photoswipe-2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.