-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathListItem.js
74 lines (70 loc) · 1.46 KB
/
ListItem.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
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { StyleSheet, View, Text, Image } from 'react-native';
import { FontAwesome as Icon } from '@expo/vector-icons';
import { getSemanticColor } from '../../theme';
const styles = StyleSheet.create( {
container: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
height: 44,
padding: 10,
},
text: {
marginLeft: 5,
},
title: {
color: getSemanticColor( 'label' ),
fontSize: 16,
},
url: {
color: getSemanticColor( 'secondaryLabel' ),
fontSize: 12,
lineHeight: 12,
},
icon: {
width: 32,
height: 32,
marginRight: 5,
borderRadius: 16,
borderWidth: 1,
borderColor: 'rgba(0,0,0,.1)',
},
iconSpacer: {
width: 37,
height: 32,
},
chevron: {
marginLeft: 'auto',
},
} );
export default class ListItem extends Component {
static propTypes = {
site: PropTypes.object.isRequired,
};
render() {
return (
<View style={ styles.container }>
{ this.props.site.icon ? (
<Image
source={ { uri: this.props.site.icon.src } }
style={ styles.icon }
/>
) : (
<View style={ styles.iconSpacer } />
) }
<View style={ styles.text }>
<Text style={ styles.title }>{ this.props.site.name }</Text>
<Text style={ styles.url }>{ this.props.site.url }</Text>
</View>
<Icon
name="chevron-right"
style={ styles.chevron }
size={ 22 }
color="#BBBBBB"
/>
</View>
);
}
}