-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStackNavigator.js
112 lines (107 loc) · 3.37 KB
/
StackNavigator.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
101
102
103
104
105
106
107
108
109
110
111
112
import { StyleSheet, Text, View } from 'react-native';
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import LoginScreen from './screens/LoginScreen';
import RegisterScreen from './screens/RegisterScreen';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import HomeScreen from './screens/HomeScreen';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Entypo } from '@expo/vector-icons';
import { AntDesign } from '@expo/vector-icons';
import { Ionicons } from '@expo/vector-icons';
import ThreadScreen from './screens/ThreadScreen';
import ActivityScreen from './screens/ActivityScreen';
import ProfileScreen from './screens/ProfileScreen';
const StackNavigator = () => {
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
function BottomTabs() {
return (
<Tab.Navigator>
<Tab.Screen
name="Home"
component={HomeScreen}
options={{
tabBarLabel: 'Home',
tabBarLabelStyle: 'black',
headerShown: false,
tabBarIcon: ({ focused }) =>
focused ? (
<Entypo name="home" size={24} color="black" />
) : (
<AntDesign name="home" size={24} color="black" />
),
}}
/>
<Tab.Screen
name="Thread"
component={ThreadScreen}
options={{
tabBarLabel: 'Create',
tabBarLabelStyle: 'black',
headerShown: false,
tabBarIcon: ({ focused }) =>
focused ? (
<Ionicons name="create" size={24} color="black" />
) : (
<Ionicons name="create-outline" size={24} color="black" />
),
}}
/>
<Tab.Screen
name="Activity"
component={ActivityScreen}
options={{
tabBarLabel: 'Activity',
tabBarLabelStyle: 'black',
headerShown: false,
tabBarIcon: ({ focused }) =>
focused ? (
<AntDesign name="heart" size={24} color="black" />
) : (
<AntDesign name="hearto" size={24} color="black" />
),
}}
/>
<Tab.Screen
name="Profile"
component={ProfileScreen}
options={{
tabBarLabel: 'Profile',
tabBarLabelStyle: 'black',
headerShown: false,
tabBarIcon: ({ focused }) =>
focused ? (
<Ionicons name="person" size={24} color="black" />
) : (
<Ionicons name="person-outline" size={24} color="black" />
),
}}
/>
</Tab.Navigator>
);
}
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Login"
component={LoginScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Register"
component={RegisterScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Main"
component={BottomTabs}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
export default StackNavigator;
const styles = StyleSheet.create({});