-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
67 lines (62 loc) · 2.01 KB
/
App.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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import MainScreen from './screens/MainScreen';
import RecommendScreen from './screens/RecommendScreen';
import HomeScreen from './screens/HomeScreen';
import EventScreen from './screens/EventScreen';
import NewmovieScreen from './screens/NewmovieScreen';
import LoginScreen from './screens/LoginPage/LoginScreen';
import ProfileScreen from './screens/ProfileScreen';
import RegisterScreen from './screens/LoginPage/RegisterScreen';
const Stack = createNativeStackNavigator();
function getHeaderTitle(route) {
const routeName = getFocusedRouteNameFromRoute(route);
const nameMap = {
Home: 'MosyMovie',
Event: '영화 이벤트',
Newmovie: '최신 개봉작',
Recommendation: '영화 추천',
Profile: '프로필',
};
return nameMap[routeName];
}
function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="LoginScreen"
component={LoginScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="HomeScreen"
component={HomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="RegisterScreen"
component={RegisterScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="MosyMovie"
component={MainScreen}
options={({ route }) => ({
title: getHeaderTitle(route),
})}
/>
<Stack.Screen name="Event" component={EventScreen} />
<Stack.Screen name="Newmovie" component={NewmovieScreen} />
<Stack.Screen name="Recommendation" component={RecommendScreen} />
<Stack.Screen
name="Profile"
component={ProfileScreen}
options={{ title: '개인 정보' }}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;