forked from dhmm/Exchange-Rates
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListItem.js
More file actions
49 lines (42 loc) · 1.04 KB
/
ListItem.js
File metadata and controls
49 lines (42 loc) · 1.04 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
import React from 'react';
import { StyleSheet, FlatList , View ,Text} from 'react-native';
export default class ListItem extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<View style = {styles.container}>
<View style = {styles.currencyView}><Text style={styles.currencyText}>{this.props.currency}</Text></View>
<View style = {styles.rateView}><Text style={styles.rateText}>{this.props.rate}</Text></View>
</View>
);
}
}
const styles = StyleSheet.create({
container : {
flex:1,
flexDirection: 'row' ,
marginBottom:2
} ,
currencyView : {
width: "20%",
padding:2,
backgroundColor : 'orangered' ,
borderTopLeftRadius : 5 ,
borderBottomLeftRadius : 5 ,
} ,
currencyText : {
color: '#fff' ,
fontSize:20
} ,
rateView: {
width: "80%",
padding:2,
marginLeft:2,
backgroundColor : 'sandybrown'
},
rateText: {
fontSize:20,
}
});