-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomeScreen.js
94 lines (89 loc) · 2.21 KB
/
HomeScreen.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
import { useNavigation } from "@react-navigation/core";
import React from "react";
import { StyleSheet, Text, TouchableOpacity, View, Image } from "react-native";
import { auth, db } from "../firebase";
import { signOut } from "firebase/auth";
import { collection, getDocs } from "firebase/firestore";
const HomeScreen = () => {
const navigation = useNavigation();
const handleSignOut = () => {
signOut(auth)
.then(() => {
navigation.replace("Login");
})
.catch((error) => alert(error.message));
};
return (
<View style={styles.container}>
<Text style={styles.emailText}>
{" "}
Logged in as: {"\n"} {auth.currentUser?.email}
</Text>
<TouchableOpacity onPress={handleSignOut} style={styles.button}>
<Text style={styles.buttonText}>Sign out</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => {}} style={styles.buttonBook}>
<Text style={styles.buttonFunctionText}>Book Ticket</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => {}} style={styles.buttonHistory}>
<Text style={styles.buttonFunctionText}>Booking History</Text>
</TouchableOpacity>
<Image source={require("../assets/PASS.png")} style={styles.image} />
</View>
);
};
export default HomeScreen;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
button: {
backgroundColor: "#0782F9",
width: "22%",
padding: 15,
borderRadius: 10,
alignItems: "center",
marginTop: 40,
bottom: 230,
right: 155,
},
buttonText: {
color: "white",
fontWeight: "700",
fontSize: 13,
},
buttonBook: {
backgroundColor: "#0782F9",
width: "30%",
padding: 15,
borderRadius: 10,
alignItems: "center",
marginTop: 40,
top: 100,
},
buttonHistory: {
backgroundColor: "#0782F9",
width: "40%",
padding: 15,
borderRadius: 10,
alignItems: "center",
marginTop: 40,
top: 100,
},
buttonFunctionText: {
color: "white",
fontWeight: "700",
fontSize: 16,
},
emailText: {
bottom: 100,
right: 133,
},
image: {
height: "20%",
aspectRatio: 2,
bottom: 250,
},
});