-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItems.js
52 lines (48 loc) · 1.25 KB
/
Items.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
import React from "react";
import { View, Text, StyleSheet, Dimensions, Image } from "react-native";
export const SLIDER_WIDTH = Dimensions.get("window").width + 80;
export const ITEM_WIDTH = Math.round(SLIDER_WIDTH * 0.7);
const Items = ({ item, index }) => {
return (
<View style={styles.container} key={index}>
<Image source={{ uri: item.imgUrl }} style={styles.image} />
<Text style={styles.header}>{item.title}</Text>
<Text style={styles.body}>{item.body}</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
backgroundColor: "white",
borderRadius: 8,
width: ITEM_WIDTH,
paddingBottom: 40,
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 3,
},
shadowOpacity: 0.29,
shadowRadius: 4.65,
elevation: 7,
},
image: {
width: ITEM_WIDTH,
height: 300,
},
header: {
color: "#222",
fontSize: 28,
fontWeight: "bold",
paddingLeft: 20,
paddingTop: 20,
},
body: {
color: "#222",
fontSize: 18,
paddingLeft: 20,
paddingLeft: 20,
paddingRight: 20,
},
});
export default Items;