-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppIndex.tsx
130 lines (124 loc) · 4.32 KB
/
AppIndex.tsx
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 React, { useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { useColorScheme } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import COLORS from './src/constants/colors';
import HomeStack from './src/navigation/HomeStack';
import SearchStack from './src/navigation/SearchStack';
import MyPageStack from './src/navigation/ProfileStack';
import SplashScreen from 'react-native-splash-screen';
const Tab = createBottomTabNavigator();
const AppIndex = () => {
useEffect(() => {
SplashScreen.hide();
}, []);
return (
<NavigationContainer>
<PublicRouter />
</NavigationContainer>
);
};
const PublicRouter = () => {
const isDark = useColorScheme() === 'dark';
return (
<Tab.Navigator
initialRouteName="Home"
sceneContainerStyle={{
backgroundColor: isDark ? COLORS.BLACK_COLOR : COLORS.WHITE_COLOR,
}}
screenOptions={{
tabBarLabel: () => {
return null;
},
tabBarStyle: {
backgroundColor: isDark ? COLORS.BLACK_COLOR : COLORS.WHITE_COLOR,
},
tabBarActiveTintColor: isDark ? COLORS.YELLOW_COLOR : COLORS.BLACK_COLOR,
tabBarInactiveTintColor: isDark ? COLORS.LIGHT_GREY : COLORS.DARK_GREY,
headerStyle: {
backgroundColor: isDark ? COLORS.BLACK_COLOR : COLORS.WHITE_COLOR,
},
headerTitleStyle: {
color: isDark ? COLORS.WHITE_COLOR : COLORS.BLACK_COLOR,
},
headerShown: false,
}}
>
<Tab.Screen
name="Home"
component={HomeStack}
options={{
tabBarIcon: ({ focused, color, size }) => {
return <Ionicons name={focused ? 'home' : 'home-outline'} color={color} size={size} />;
},
}}
/>
<Tab.Screen
name="SearchList"
component={SearchStack}
options={{
tabBarIcon: ({ focused, color, size }) => {
return (
<Ionicons name={focused ? 'search' : 'search-outline'} color={color} size={size} />
);
},
}}
/>
<Tab.Screen
name="Profile"
component={MyPageStack}
options={{
tabBarIcon: ({ focused, color, size }) => {
return (
<Ionicons name={focused ? 'person' : 'person-outline'} color={color} size={size} />
);
},
}}
/>
</Tab.Navigator>
);
};
// const PrivateRouter = () => {
// const navigation = useNavigation();
// return (
// <Stack.Navigator initialRouteName="LoginPage">
// <Stack.Group screenOptions={{ headerShown: false }}>
// <Stack.Screen name="LoginPage" component={LoginPage} />
// </Stack.Group>
// <Stack.Group
// screenOptions={{
// title: '회원가입',
// headerLeft: () => {
// return (
// <Ionicons
// name="chevron-back-outline"
// size={28}
// onPress={() => {
// navigation.goBack();
// }}
// />
// );
// },
// }}
// >
// <Stack.Screen name="RegisterPage" component={RegisterPage} />
// <Stack.Screen name="OnboardingEmail" component={OnboardingEmail} />
// <Stack.Screen name="OnboardingPw" component={OnboardingPw} />
// <Stack.Screen name="OnboardingRePw" component={OnboardingRePw} />
// <Stack.Screen name="OnboardingGender" component={OnboardingGender} />
// <Stack.Screen name="OnboardingAge" component={OnboardingAge} />
// <Stack.Screen name="OnboardingNickname" component={OnboardingNickname} />
// <Stack.Screen name="OnboardingAccord" component={OnboardingAccord} />
// <Stack.Screen name="OnboardingEvent" component={OnboardingEvent} />
// <Stack.Screen name="OnboardingResult" component={OnboardingResult} />
// <Stack.Group>
// <Stack.Screen name="Service" component={ServicePage} />
// <Stack.Screen name="Information" component={InformationPage} />
// <Stack.Screen name="Promotion" component={PromotionPage} />
// </Stack.Group>
// </Stack.Group>
// </Stack.Navigator>
// );
// };
export default AppIndex;