
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
react-photostory
Advanced tools
#react-photostory
A lightweight carousel made in React and optimized for mobile.
Demo is available here. Make sure devtools is open and mobile emulation is selected as this library currently only supports touch events.
##Features
This library works with react-lazy-card (don't worry. they are very light even when used together . react-lazy-card may serve other purposes in the app so we separated it).
npm install --save react-photostory react-lazy-card
JSX:
import Swipe from 'react-photostory';
import LazyCard from 'react-lazy-card';
<Swipe className="photostory">
<LazyCard image="a.jpg" defaultImage="default1.jpg">Text 1</LazyCard>
<LazyCard image="b.jpg" defaultimage="default2.jpg">Text 2</LazyCard>
</Swipe>
CSS
@import "react-photostory/dist/swipe"
prop | default | description |
---|---|---|
className | '' | Custom classname |
initialIndex | 0 | initially visible slide index |
autoPlay | false | whether to display slide show or not |
overScan | 0 | Number of Slide offsets to load excluding the current slide.If its 1 it will load current, current+-1 |
onSwipe | ({initialIndex, currentIndex}) | function executed whenever the current slide changes |
onClick | {index} | function executed when a slide is clicked |
prev | <button>PREV</button> | React element to replace the PREV button |
next | <button>NEXT</button> | React element to replace the NEXT button |
threshold | 0.5 | Ratio of carousel width one should drag to make successful swipe |
responsive | false | whether or not to listen to window resize event |
renderFirst | true | don't lazy load the initial slide |
To manually go to a particular slide you can use gotoSlide(i)
method
const x = (
<Swipe className="photostory">
<LazyCard image="a.jpg" defaultImage="default1.jpg">Text 1</LazyCard>
<LazyCard image="b.jpg" defaultimage="default2.jpg">Text 2</LazyCard>
<LazyCard image="c.jpg" defaultimage="default3.jpg">Text 2</LazyCard>
</Swipe>
)
x.gotoSlide(2) // will go to the 3rd slide
git clone https://github.com/housinghq/react-photostory
cd react-photostory
npm install
npm run storybook
Make sure you develop in emulation mode (open devtools and select mobile emulation). Currently this only supports touch events.
Open an issue before opening a PR. This package is optimised for mobile so its hard to include all the features.
###License MIT @ Loconsolutions
FAQs
A mobile optimised lighweight gallery component written in React
The npm package react-photostory receives a total of 3 weekly downloads. As such, react-photostory popularity was classified as not popular.
We found that react-photostory 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.