-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavigation.js
161 lines (151 loc) · 3.99 KB
/
Navigation.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import React from "react";
import { createStackNavigator } from "@react-navigation/stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { NavigationContainer } from "@react-navigation/native";
import { Image } from "react-native";
import Home from "./screens/home";
import Login from "./screens/Login";
import Friend from "./screens/friend";
import MyPage from "./screens/mypage";
import Splash from "./screens/splash";
import Calendar from "./screens/calendar";
import Search from "./screens/search";
import Alarm from "./screens/alarm";
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
const activeHomeIcon = require("./assets/navigation/home1.png");
const inactiveHomeIcon = require("./assets/navigation/home.png");
const activeCalendarIcon = require("./assets/navigation/calendar1.png");
const inactiveCalendarIcon = require("./assets/navigation/calendar.png");
const activeFriendIcon = require("./assets/navigation/friend1.png");
const inactiveFriendIcon = require("./assets/navigation/friend.png");
const activeMyIcon = require("./assets/navigation/my1.png");
const inactiveMyIcon = require("./assets/navigation/my.png");
function TabNavigator() {
return (
<Tab.Navigator
tabBarOptions={{
labelStyle: {
color: "black",
},
inactiveTintColor: "gray",
}}
>
<Tab.Screen
name="홈"
component={Home}
options={({ route }) => ({
tabBarIcon: ({ focused }) => (
<Image
source={focused ? activeHomeIcon : inactiveHomeIcon}
style={{ width: 24, height: 24 }}
/>
),
headerShown: false,
})}
/>
<Tab.Screen
name="캘린더"
component={Calendar}
options={({ route }) => ({
tabBarIcon: ({ focused }) => (
<Image
source={focused ? activeCalendarIcon : inactiveCalendarIcon}
style={{ width: 24, height: 24 }}
/>
),
headerShown: false,
})}
/>
<Tab.Screen
name="친구별"
component={Friend}
options={({ route }) => ({
tabBarIcon: ({ focused }) => (
<Image
source={focused ? activeFriendIcon : inactiveFriendIcon}
style={{ width: 24, height: 24 }}
/>
),
headerShown: false,
})}
/>
<Tab.Screen
name="마이"
component={MyPage}
options={({ route }) => ({
tabBarIcon: ({ focused }) => (
<Image
source={focused ? activeMyIcon : inactiveMyIcon}
style={{ width: 24, height: 24 }}
/>
),
headerShown: false,
})}
/>
</Tab.Navigator>
);
}
function StackScreen() {
return (
<Stack.Navigator initialRouteName="Splash">
<Stack.Screen
name="Splash"
component={Splash}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Login"
component={Login}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Home"
component={TabNavigator}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Search"
component={Search}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Friend"
component={Friend}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Alarm"
component={Alarm}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Calendar"
component={Calendar}
options={{
headerShown: false,
}}
/>
</Stack.Navigator>
);
}
function Navigation() {
return (
<NavigationContainer>
<StackScreen />
</NavigationContainer>
);
}
export default Navigation;