
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
react-image-viewer-mobile
Advanced tools
A ReactJS image Viewer Component for mobile 一款基于react的图片预览组件,特别适合于异步获取的富文本中的图片,点击图片即可全屏显示,并且带有轮播效果。
npm install react-image-viewer-mobile --save
'use strict';
import React from 'react';
import NewsBox from '../NewsBox';
import ImagePreviewer from 'react-image-viewer-mobile'
// import ImagePreviewer from '../../../dist/react-image-viewer-mobile.js'
class News extends React.Component {
render() {
return (
<div>
<ImagePreviewer
async={true} /*图片内容是否异步*/
imageWrapperHeight={300} /*图片容器高度*/
opacity={1} /*背景透明度*/
zIndex={1000} /*图层层级*/
gap={10} /*图片间隙*/
>
<NewsBox content={this.props.content}/> /*异步获取的富文本*/
</ImagePreviewer>
</div>
);
}
}
export default News
//新闻内容组件 NewsBox
import React from 'react';
class NewsBox extends React.Component {
render() {
return (
<div dangerouslySetInnerHTML={{__html: this.props.content}}>
</div>
);
}
}
export default NewsBox
The demo can be launched on local machine via webpack-dev-server
. Run the following:
webpack-dev-server --config webpack.dev.config.js --color --progress
Property | Description | Type | default | Remarks |
---|---|---|---|---|
async | is images async? | Boolean | false | 图片内容是否异步 |
zIndex | the depth of the layer | Number | 1000 | 图层层级 |
gap | the gap between images | Number | 10 | 图片间隙 |
opacity | the backgroup modal's opacity | Number | 1 | 背景透明度 |
imageWrapperHeight | the height of image wrapper | Number | 300 | 图片容器高度 |
FAQs
a react component for view images in mobile
The npm package react-image-viewer-mobile receives a total of 6 weekly downloads. As such, react-image-viewer-mobile popularity was classified as not popular.
We found that react-image-viewer-mobile 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.