HeaderCell.js
1.83 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
'use strict';
import React, {Component} from 'react';
import ReactNative, {
View,
Text,
Image,
ListView,
StyleSheet,
Dimensions,
TouchableOpacity,
InteractionManager,
Platform,
} from 'react-native';
export default class List extends Component {
constructor(props) {
super(props);
}
render() {
let resource = this.props.resource;
if (!resource) {
return null;
}
return (
<View style={styles.headerContent}>
<Image style={styles.avatar} source={{uri:resource.avatar}}/>
<View style={styles.headerRight}>
<Text style={styles.title}>{resource.name}</Text>
<Text style={styles.subTitle}>{resource.author_desc?resource.author_desc:''}</Text>
</View>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
headerContent: {
height: 104,
width: width,
backgroundColor: 'white',
flexDirection: 'row',
borderColor: 'rgb(215, 215, 215)',
borderTopWidth: 1,
},
avatar: {
marginTop: 20,
marginLeft: 15,
width: 50,
height: 50,
borderRadius: 25,
backgroundColor: 'gray',
},
headerRight: {
marginTop: 24,
marginLeft: 20,
flexDirection: 'column',
marginRight: 0,
backgroundColor: 'white',
height: 45,
width: width - 100,
justifyContent: 'space-between',
},
title: {
fontSize: 16,
color: 'rgb(83, 83, 83)',
textAlign: 'left',
width: width - 100,
},
subTitle: {
fontSize: 13,
color: 'rgb(215, 215, 215)',
textAlign: 'left',
width: width - 100,
}
});