
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
react-native-notification-stack-card
Advanced tools
A React Native stack list for notification card
A React Native stack list for notification card
npm install react-native-notification-stack-card --save
Import StackCardList component:
import StackCardList from 'react-native-notification-stack-card';
Usage:
<StackCardList
data={data}
visibleItems={VISIBLE_ITEMS}
itemWidth={ITEM_WIDTH}
itemHeight={ITEM_HEIGHT}
closeButtonView={<Icon name={'close'} color={'#ffffff'} size={20} />}
stackType={'above'}
spacing={SPACING}
onEmpty={this.onEmpty}
onItemPress={this.onItemPress}
renderItem={this.renderItem}
/>
)
Customize your notification view based on index and activeIndex:
const renderItem = (item: any) => {
const {index, activeIndex} = item;
const isActiveIndex = index === activeIndex;
const isSecondIndex = (index === index) === activeIndex + 1;
const isThirdIndex = index === activeIndex + 2;
const isAfterClicked = index < activeIndex;
const backgroundColor = isActiveIndex
? 'transparent'
: isSecondIndex
? '#95A9F7'
: isThirdIndex
? '#BDC9F9'
: isAfterClicked
? '#BDC9F9'
: '#95A9F7';
return <YourContentView backgroundColor={backgroundColor} />;
};
To create close button there are 2 option:
closeButtonView
props. The position is absolute (left: 20, top: 20). Pass your x
icon or anything your view.next()
when it pressed.prop | type/valid values | default | description |
---|---|---|---|
visibleItems | number | 3 | Number of visible items |
stackType | string | 'below' | above / below |
data | any | [] | Array data of notification item |
itemWidth | number | 100 | Note: You also need configure width on your renderItem |
itemHeight | number | 100 | Note: You also need configure height on your renderItem |
spacing | number | 10 | Spacing of your item |
closeButtonView | ReactElement | null | View of close button |
renderItem | (item: any) => () | null | Rendering your item. Destructure activeIndex from item and customize based on it. |
onItemPress | (index: number: item: any) => () | null | Callback when your item press |
onEmpty | () => () | null | Callback when you already close all your item |
function | description |
---|---|
next() | To close your active notif and next to the notif behind |
This repository contains a demo React Native application with a customizable example of the StackCardList
component in use.
To use the demo application:
https://github.com/iqbalansyor/react-native-notification-stack-card.git
cd path/to/this/repository/react-native-notification-stack-card/Example
npm install
cd ios && pod install && cd ..
npm run start
|| react-native run-android
|| react-native run-ios
Feel free to try it out. Please submit a pull request with any features/fixes for the project.
This project is licensed under the MIT License - see the MIT Open Source Initiative for details.
FAQs
A React Native stack list for notification card
The npm package react-native-notification-stack-card receives a total of 4 weekly downloads. As such, react-native-notification-stack-card popularity was classified as not popular.
We found that react-native-notification-stack-card 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.