
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.
pcln-modal
Advanced tools
React modal component
npm i pcln-modal
import Modal from 'pcln-modal'
import { Modal } from 'pcln-modal'
;<Modal
ariaLabel='This is an example Modal' //sets the aria-label of the DialogContent
isOpen={true} //boolean for control this status of modal
onClose={someFunc} //func function for handle close the modal while click on the overlay
bg='white' //modal background color
zIndex={5} //zIndex
imgMode={false} //default false, will add padding to the modal, if true, then there will be no padding
width={['100px', '200px']} //responsive width the modal
header={<SomeHeaderComponent />} //Component for header, could import predefined ones too
disableCloseButton={true} //there will be a floating close button, when enabledOverflow = true, it's there by default
enableOverflow={false} //when enabled, the modal will extend over the screen based on content, otherwise it will follow height
height={['100px', '200px']} //responsive height, when enableOverflow={true}, it's not in use
verticalAlignment='middle' // Aligns dialog body vertically - options = ['middle', 'top', 'bottom']
overlayAnimation={null} // Accepts a function which overwrites default animation
dialogAnimation={null} // Accepts a function which overwrites default animation
timeout={500} // Accepts a number which overwrites the default delay for the open animation to begin, default is 500ms
>
<SomeChildComponent />
</Modal>
Note: <Modal>
relies on values from theme
, so it must be a descendent of <ThemeProvider>
in order to work properly. Otherwise, you might experience errors like this:
Uncaught TypeError: Cannot read property '3' of undefined
This helper class will prevent background scroll when modal is open. However, there can be only one instance of this helper is working in a page since it messes with body style
import { ScrollLock } from 'pcln-modal'
class SomeWrapper extends React.component {
constructor(props) {
super(props)
this.scrollLock = new ScrollLock()
}
openModalFunc() {
this.scrollLock.on()
this.setState({
modalOpen: true,
})
}
closeModalFunc() {
this.scrollLock.off()
this.setState({
modalOpen: false,
})
}
}
For its animations, this Modal currently uses react-transition-group
. This means that the following hooks are exposed during the animation life cycle: [ entering
, entered
, exiting
, exited
]
We can then use these states to write custom animations, like so:
const MY_ANIMATION = (transitionState) => `
transform: scale(0.5);
transition: transform .5s cubic-bezier(0.50, 0.00, 0.25, 1.00);
${transitionState === 'entering' ? `transform: scale(0.5);` : ''}
${transitionState === 'entered' ? `transform: scale(1);` : ''}
${transitionState === 'exiting' ? `transform: scale(0.5);` : ''}
${transitionState === 'exited' ? `transform: scale(0.5);` : ''}
`
FAQs
React component for modal
The npm package pcln-modal receives a total of 6,783 weekly downloads. As such, pcln-modal popularity was classified as popular.
We found that pcln-modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers 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.