images gallery component
Expo
expo install react-native-gesture-handler @shopify/flash-list react-native-reanimated react-native-safe-area-context
## only if using expo-dev-client
expo prebuild
yarn add @binarapps/react-native-images-gallery
npm install @binarapps/react-native-images-gallery
React native
yarn add react-native-gesture-handler @shopify/flash-list react-native-reanimated react-native-safe-area-context
yarn add @binarapps/react-native-images-gallery
npm install react-native-gesture-handler @shopify/flash-list react-native-reanimated react-native-redash react-native-safe-area-context
npm install @binarapps/react-native-images-gallery
module.exports = {
presets: [
...
],
plugins: [
...
'react-native-reanimated/plugin',
],
};
import { SafeAreaProvider } from 'react-native-safe-area-context';
function App() {
return <SafeAreaProvider>...</SafeAreaProvider>;
}
import * as React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
import Gallery from '@binarapps/react-native-images-gallery';
export default function App() {
const [isGalleryVisible, setIsGalleryVisible] = React.useState(false);
const images = [
{
uri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/640px-Image_created_with_a_mobile_phone.png',
name: 'name',
description: 'string',
},
{
uri: 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg',
name: 'name',
description: 'string',
},
];
return (
<SafeAreaProvider>
<View style={styles.container}>
{isGalleryVisible && (
<Gallery
handleCloseGallery={() => setIsGalleryVisible(false)}
images={images}
/>
)}
{!isGalleryVisible && (
<TouchableOpacity onPress={() => setIsGalleryVisible(true)}>
<Text>Open Gallery</Text>
</TouchableOpacity>
)}
</View>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
Change node version to v16.18.0 https://apple.stackexchange.com/questions/171530/how-do-i-downgrade-node-or-install-a-specific-previous-version-using-homebrew
- Damian Piętka - @oscris1
- Mateusz Rostkowski - @MateuszRostkowski
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library