-
Notifications
You must be signed in to change notification settings - Fork 0
/
PropertyView.js
72 lines (66 loc) · 1.48 KB
/
PropertyView.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
'use strict';
var React = require('react-native');
var {
Component,
StyleSheet,
Image,
View,
Text
} = React;
class PropertyView extends Component {
render(){
var property = this.props.property;
var stats = property.bedroom_number + ' bed ' + property.property_type;
if (property.bathroom_number) {
stats += ', ' + property.bathroom_number + ' ' + (property.bathroom_number > 1
? 'bathrooms' : 'bathroom');
}
var price = property.price_formatted.split(' ')[0];
return (
<View style={styles.container}>
<Image style={styles.iamge}
source={{uri: property.img_url}} />
<View style={styles.heading}>
<Text style={styles.price}>${price}</Text>
<Text style={styles.title}>{property.title}</Text>
<View style={styles.separator} />
</View>
<Text style={styles.description}>{stats}</Text>
<Text style={styles.description}>{property.summary}</Text>
</View>
);
}
}
var styles = StyleSheet.create({
container: {
marginTop: 65
},
heading: {
backgroundColor: '#F8F8F8'
},
separator: {
height: 1,
backgroundColor: '#DDDDDD'
},
iamge: {
width: 400,
height: 300
},
price: {
fontSize: 25,
fontWeight: 'bold',
margin: 5,
color: '#48BBEC'
},
title: {
fontSize: 20,
margin: 5,
color: '#656565'
},
description: {
fontSize: 18,
margin: 5,
color: '#656565'
}
});
module.exports = PropertyView;