Skip to content

Instantly share code, notes, and snippets.

@vikrantnegi
Last active February 18, 2020 12:22
Show Gist options
  • Save vikrantnegi/0da413f97921347308ab81037e15af77 to your computer and use it in GitHub Desktop.
Save vikrantnegi/0da413f97921347308ab81037e15af77 to your computer and use it in GitHub Desktop.
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