-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbig-component.js
72 lines (66 loc) · 1.57 KB
/
big-component.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
import React from 'react';
import { View, Text, StyleSheet, Image } from 'react-native';
class BigComponent extends React.PureComponent {
render() {
const {image, title, trail, body} = this.props;
return (
<View style={ styles.container }>
<View style={ { flexDirection: 'row' } }>
<Image
style={ styles.image }
source={ { uri: image } }
/>
<View style={ { padding: 16, backgroundColor: 'white', flex: 1 } }>
<Text style={ styles.title }>
{ title }
</Text>
<Text
style={styles.body}
ellipsizeMode={'tail'}
numberOfLines={5}
>
{body}
</Text>
</View>
</View>
<View style={{flex: 1, backgroundColor: '#dddee2', padding: 8}}>
<Text style={{marginBottom: 4, fontSize: 18, fontWeight: 'bold'}}>
{'Super powers'}
</Text>
{
trail.map((text) => (
<Text
key={text}
style={{
fontSize: 11,
marginLeft: 8,
}}
>
{'• '}{text}
</Text>
))
}
</View>
</View>
);
}
};
const styles = StyleSheet.create({
container: {
height: 250,
borderRadius: 20,
overflow: 'hidden',
},
title: {
fontSize: 24,
},
image: {
height: 160,
width: 90,
},
body: {
flex: 1,
marginTop: 8,
},
});
export default BigComponent;