-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppInner.tsx
48 lines (42 loc) · 1.55 KB
/
AppInner.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
import AsyncStorage from '@react-native-async-storage/async-storage';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {useNavigation} from '@react-navigation/native';
import React, {useEffect} from 'react';
import TabBar from 'src/components/utils/TabBar';
import RouteBoothScreen from 'src/screens/BoothScreen';
import RouteRecommendScreen from 'src/screens/RecommendScreen';
import RouteRecordScreen from 'src/screens/RecordScreen';
import StorageScreen from 'src/screens/StorageScreen/StorageScreen';
const Tab = createBottomTabNavigator();
const AppInner = () => {
const navigation = useNavigation();
useEffect(() => {
AsyncStorage.getItem('alreadyLaunched').then(value => {
if (value == null) {
AsyncStorage.setItem('alreadyLaunched', 'true');
navigation.navigate('InitPermissionScreen' as never);
}
});
}, []);
return (
<Tab.Navigator screenOptions={{headerShown: false}} tabBar={props => <TabBar {...props} />}>
<Tab.Screen
name={'RouteRecommendScreen'}
component={RouteRecommendScreen}
options={{tabBarLabel: '추천'}}
/>
<Tab.Screen
name={'BoothScreen'}
component={RouteBoothScreen}
options={{tabBarLabel: '위치'}}
/>
<Tab.Screen name={'StorageScreen'} component={StorageScreen} options={{tabBarLabel: '찜'}} />
<Tab.Screen
name={'RouteRecordScreen'}
component={RouteRecordScreen}
options={{tabBarLabel: '기록'}}
/>
</Tab.Navigator>
);
};
export default AppInner;