-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tickets.js
101 lines (97 loc) · 2.79 KB
/
Tickets.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
97
98
99
100
import React from "react";
import { StyleSheet, Text, View, FlatList, Image, TouchableOpacity } from "react-native";
import globoTickets from "./TicketsDB";
const Tickets = ({ navigation }) => {
const ticketItem = ({ item }) => {
return (
<View style={styles.tickets}>
<View>
<Image
style={styles.img}
source={item.image}
/>
</View>
<View>
<Text
style={styles.ticketTitle}
>
{item.event}
</Text>
<Text
style={styles.ticketShortDescription}
>
{item.shortDescription}
</Text>
<Text
style={styles.ticketDescription}
numberOfLines={2}
ellipsizeMode="tail"
>
{item.description}
</Text>
<Text
style={styles.ticketShortDescription}
>
Price: ${item.price}
</Text>
<TouchableOpacity
onPress={() => {
navigation.navigate("TicketPurchase", { ticketId: item.eventId })
}}
style={styles.button}
>
<Text style={styles.ticketButton}>
GET TICKETS
</Text>
</TouchableOpacity>
</View>
</View>
);
};
return (
<View style={styles.container}>
<FlatList
data={globoTickets}
renderItem={ticketItem}
keyExtractor={(item) => item.eventId}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
paddingTop: 15,
paddingBottom: 15
},
tickets: {
flexDirection: "column"
},
img: {
height: 180,
width: "100%"
},
ticketTitle: {
fontFamily: "Ubuntu-Regular",
fontWeight: "bold",
textAlign: "center"
},
ticketShortDescription: {
fontFamily: "Ubuntu-Light",
fontWeight: "600",
textAlign: "center",
paddingTop: 5
},
ticketDescription: {
fontFamily: "Ubuntu-Light",
fontWeight: "600",
padding: 15
},
ticketButton: {
fontFamily: "Ubuntu-Regular",
fontWeight: "bold",
textAlign: "center",
paddingTop: 5,
paddingBottom: 15
}
});
export default Tickets;