-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBookDetails.js
120 lines (107 loc) · 2.43 KB
/
BookDetails.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
'use strict';
var React = require('react-native');
var {
View,
ScrollView,
Text,
Image,
StyleSheet
} = React;
var BookDetails = React.createClass({
render: function() {
return (
<ScrollView>
<View style={styles.topContainer}>
<Image
style={styles.thumbnail}
source={{uri:
this.props.book.volumeInfo.imageLinks.smallThumbnail}}
/>
<View style={styles.titlesContainer}>
<Text style={styles.title}>
{this.props.book.volumeInfo.title}
</Text>
<Text style={styles.subtitle}>
{this.props.book.volumeInfo.subtitle}
</Text>
</View>
</View>
<View style={styles.middleContainer}>
<Text style={styles.description}>
{this.props.book.volumeInfo.description}
</Text>
</View>
<View style={styles.bottomContainer}>
<Text style={styles.author}>
Author: {this.props.book.volumeInfo.authors[0]}
</Text>
</View>
</ScrollView>
);
}
});
var Dimensions = require('Dimensions');
var windowSize = Dimensions.get('window');
var styles = StyleSheet.create({
topContainer: {
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'flex-start',
backgroundColor: '#5AC8FA'
},
thumbnail: {
width: 70,
height: 108,
marginRight: 16
},
titlesContainer: {
flex: 1,
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'flex-start',
backgroundColor: '#5AC8FA',
width: windowSize.width - 86,
paddingTop: 8,
paddingRight: 8
},
title: {
fontSize: 20,
fontWeight: 'bold',
color: '#fff'
},
subtitle: {
fontSize: 16,
fontWeight: 'normal',
color: '#fff'
},
middleContainer: {
flex: 1,
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'flex-start',
backgroundColor: '#fff',
margin: 16
},
description: {
fontFamily: 'Times',
fontSize: 16,
fontWeight: 'normal',
color: '#000',
marginBottom: 8
},
bottomContainer: {
flex: 1,
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'flex-start',
backgroundColor: '#5AC8FA',
padding: 8
},
author: {
fontSize: 16,
fontWeight: 'normal',
color: '#fff'
}
});
module.exports = BookDetails;