Last active
February 18, 2020 12:22
-
-
Save vikrantnegi/0da413f97921347308ab81037e15af77 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const BookCardComponent = props => { | |
const { thumbnail, title, authors, onPress } = props; | |
return ( | |
<View style={styles.shadow}> | |
<TouchableOpacity | |
onPress={onPress} | |
style={{ | |
flexDirection: "row", | |
padding: 8 | |
}} | |
> | |
<View | |
style={{ | |
flex: 1, | |
height: responsiveHeight(16), | |
width: responsiveWidth(16), | |
marginRight: 10 | |
}} | |
> | |
<Image | |
source={{ uri: thumbnail }} | |
style={{ | |
borderRadius: 4, | |
resizeMode: "contain", | |
height: "100%", | |
width: "100%" | |
}} | |
imageStyle={{ borderRadius: 1 }} | |
/> | |
</View> | |
<View | |
style={{ | |
flex: 3, | |
padding: 5 | |
}} | |
> | |
<Text style={{ marginBottom: 5, fontSize: 20 }}>{title}</Text> | |
<Text | |
style={{ marginBottom: 5 }} | |
numberOfLines={1} | |
ellipsizeMode="tail" | |
> | |
by {authors} | |
</Text> | |
</View> | |
</TouchableOpacity> | |
</View> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment