-
Notifications
You must be signed in to change notification settings - Fork 0
/
Content.js
96 lines (94 loc) · 2.32 KB
/
Content.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import {View, Text, Image, Button} from 'react-native';
import React, {Component} from 'react';
import dataContent from './NewsDataSources';
export default function Content() {
const btn = () => {
alert('Coming Soon');
};
return (
<View>
{dataContent.map(item => {
return (
<View key={item.id}>
<View style={{paddingHorizontal: 15, backgroundColor: 'white'}}>
<View style={style.container}>
<View>
<Image style={style.logo} source={item.logo} />
<View>
<View style={style.shadow}></View>
<Image style={style.img} source={item.image} />
</View>
</View>
<View style={{margin: 10}}>
<Text
style={{fontSize: 20, marginTop: 10, fontWeight: 'bold'}}>
{item.title}
</Text>
<Text style={{marginTop: 10, fontSize: 15}}>{item.text}</Text>
</View>
<View
style={
item.button === 'left'
? style.btnLeft
: item.button === 'center'
? style.btnCenter
: style.btnRight
}>
<Button color={item.b} onPress={btn} title="Read More" />
</View>
</View>
</View>
</View>
);
})}
</View>
);
}
const style = {
container: {
paddingTop: 20,
borderWidth: 1,
borderColor: 'transparent',
borderBottomColor: '#d2d2d2',
paddingBottom: 50,
},
logo: {
width: '20%',
height: 23,
position: 'absolute',
zIndex: 2,
margin: 10,
},
shadow: {
backgroundColor: 'black',
width: '100%',
height: 220,
zIndex: 1,
opacity: 0.22,
borderRadius: 15,
},
img: {
width: '100%',
height: 220,
position: 'absolute',
borderRadius: 15,
},
btnLeft: {
width: 100,
marginLeft: 10,
alignSelf: 'flex-start',
paddingHorizontal: -20,
},
btnRight: {
width: 100,
marginLeft: 10,
alignSelf: 'flex-end',
paddingHorizontal: -20,
},
btnCenter: {
width: 100,
marginLeft: 10,
alignSelf: 'center',
paddingHorizontal: -20,
},
};