Created
July 7, 2019 15:53
-
-
Save Charpell/d998d24e3b3124c09816199524af6c8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { TouchableOpacity, FlatList } from 'react-native' | |
import styled from 'styled-components'; | |
import metrics from '../utils/metrics'; | |
export default ImageList = ({ navigation, images }) => { | |
return ( | |
<FlatList | |
data={images} | |
horizontal | |
keyExtractor={(i, t) => t.toString()} | |
style={{ height: 146 }} | |
contentContainerStyle={{ height: 146 }} | |
renderItem={({ item }) => ( | |
<TouchableOpacity | |
onPress={() => navigation.navigate('Book', { image: item.uri })} | |
> | |
<Image source={{ uri: item.uri }}/> | |
</TouchableOpacity> | |
)} | |
/> | |
) | |
} | |
const Image = styled.Image` | |
width: ${metrics.width * 0.3}; | |
height: ${metrics.height * 0.17}; | |
border-radius: 15px; | |
margin: 10px; | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment