-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
130 lines (122 loc) · 3.88 KB
/
App.js
File metadata and controls
130 lines (122 loc) · 3.88 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import * as React from "react";
import { Text, View, TouchableOpacity } from "react-native";
import { Entypo } from "@expo/vector-icons";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import AsyncStorage from "@react-native-async-storage/async-storage";
import Gallery from "./components/gallaery";
import Login from "./components/Login";
import EnterUsername from "./components/enterUsername";
import OtpVerificationScreen from "./components/otpVerification";
import SignUp from "./components/signUp";
import FriendsSection from "./components/friendsSection";
import ProfilePage from "./components/profilePage";
import GroupSection from "./components/groupSection";
import GoogleDrive from "./components/googleDrive";
const Tab = createBottomTabNavigator();
const Stack = createNativeStackNavigator();
function SettingsScreen({ navigation }) {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<TouchableOpacity
onPress={async () => {
await AsyncStorage.removeItem("token");
await AsyncStorage.removeItem("user");
await AsyncStorage.removeItem("authEmailId");
navigation.replace("Login");
}}
>
<Text>Logout</Text>
</TouchableOpacity>
</View>
);
}
function HomeScreen() {
return (
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color = "black", size = 24 }) => {
let iconName;
if (route.name === "Gallery") {
iconName = "home";
} else if (route.name === "Profile") {
iconName = "user";
}else if (route.name === "Group") {
iconName = "images";
}
else if (route.name === "Friends") {
iconName = "users";
}
// You can return any component that you like here!
return <Entypo name={iconName} size={size} color={color} />;
},
tabBarActiveTintColor: "lightblue",
tabBarInactiveTintColor: "gray",
tabBarActiveBackgroundColor: "black",
tabBarInactiveBackgroundColor: "black",
})}
>
<Tab.Screen
name="Gallery"
component={Gallery}
options={{ headerShown: false }}
/>
<Tab.Screen
name="Friends"
component={FriendsSection}
options={{ headerShown: false }}
/>
<Tab.Screen
name="Group"
component={GroupSection}
options={{ headerShown: false }}
/>
<Tab.Screen
name="Profile"
component={ProfilePage}
options={{ headerShown: false }}
/>
</Tab.Navigator>
);
}
export default function App() {
return (
// <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
// <Login />
// </View>
// <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
// <Gallery />
// </View>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Login"
component={Login}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name='Activate'
component={OtpVerificationScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="EnterUsername"
component={EnterUsername}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Signup"
component={SignUp}
options={{ headerShown: false }}
/>
{/* <Stack.Screen name="Settings" component={Settings} /> */}
</Stack.Navigator>
</NavigationContainer>
);
}