-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBookItem.js
47 lines (41 loc) · 1.15 KB
/
BookItem.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React, { Component } from "react";
import { StyleSheet, Text, View, Image, ListView } from "react-native";
const styles = StyleSheet.create({
bookItem: {
flexDirection: "row",
backgroundColor: "#FFFFFF",
borderBottomColor: "#AAAAAA",
borderBottomWidth: 2,
padding: 5,
height: 175
},
cover: {
//width: "10%", height: "20%"
flex: 1,
height: 150,
resizeMode: "contain"
},
info: {
flex: 3,
alignItems: "flex-end",
flexDirection: "column",
alignSelf: "center",
padding: 20
},
author: { fontSize: 18 },
title: { fontSize: 18, fontWeight: "bold" }
});
class BookItem extends Component {
render() {
return (
<View style={styles.bookItem}>
<Image style={styles.cover} source={{uri: this.props.coverURL}} />
<View style={styles.info}>
<Text style={styles.author}>{this.props.author}</Text>
<Text style={styles.title}>{this.props.title}</Text>
</View>
</View>
);
}
}
export default BookItem;