
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-native-image-grid
Advanced tools
React Native component that handles the complexities of building a grid of photos with a flexible number of photos per row.
React Native component that handles the complexities of building a grid of photos with a flexible number of photos per row
npm install react-native-image-grid --save
import React from 'react-native';
import PhotoGrid from 'react-native-image-grid';
let { Image, TouchableOpacity, Text } = React;
class BestGrid extends React.Component {
constructor() {
super();
this.state = { items: [] };
}
componentDidMount() {
// Build an array of 60 photos
let items = Array.apply(null, Array(60)).map((v, i) => {
return { id: i, src: 'http://placehold.it/200x200?text='+(i+1) }
});
this.setState({ items });
}
render() {
return(
<PhotoGrid
data = { this.state.items }
itemsPerRow = { 3 }
itemMargin = { 1 }
itemPaddingHorizontal={1}
renderHeader = { this.renderHeader }
renderItem = { this.renderItem }
/>
);
}
renderHeader() {
return(
<Text>I'm on top!</Text>
);
}
renderItem(item, itemSize, itemPaddingHorizontal) {
return(
<TouchableOpacity
key = { item.id }
style = {{ width: itemSize, height: itemSize, paddingHorizontal: itemPaddingHorizontal }}
onPress = { () => {
// Do Something
}}>
<Image
resizeMode = "cover"
style = {{ flex: 1 }}
source = {{ uri: item.src }}
/>
</TouchableOpacity>
)
}
}
export default BestGrid;
This repository is a fork of react-native-photo-grid
with improvements
FAQs
React Native component that handles the complexities of building a grid of photos with a flexible number of photos per row.
The npm package react-native-image-grid receives a total of 25 weekly downloads. As such, react-native-image-grid popularity was classified as not popular.
We found that react-native-image-grid 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.