-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropertyView.js
More file actions
69 lines (63 loc) · 1.37 KB
/
PropertyView.js
File metadata and controls
69 lines (63 loc) · 1.37 KB
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
'use strict'
var React = require('react-native');
var {
StyleSheet,
Image,
View,
Text,
Component
} = React;
var styles = StyleSheet.create({
container:{
marginTop:65
},
heading:{
backgroundColor:'#F8F8F8'
},
separator:{
height:1,
backgroundColor:'#dddddd'
},
image:{
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'
}
});
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.image}
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> );
} }
module.exports = PropertyView;