-
Notifications
You must be signed in to change notification settings - Fork 1
/
Navigator.tsx
57 lines (49 loc) · 1.42 KB
/
Navigator.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
import React from 'react';
import {NavigationContainer, DarkTheme} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import LoaderScreen from './src/screens/LoaderScreen';
import MainScreen from './src/screens/MainScreen';
import PlayerScreen from './src/screens/PlayerScreen';
import {navigationRef} from './RootNavigation';
import {COLOR_TEXT_PRIMARY, COLOR_WHITE} from './src/constants/colors';
const myTheme = {
...DarkTheme,
colors: {
...DarkTheme.colors,
primary: COLOR_WHITE,
text: COLOR_TEXT_PRIMARY,
},
};
export type RootStackParamList = {
Loader: undefined;
Main: undefined;
Player: undefined;
};
const Stack = createStackNavigator<RootStackParamList>();
const Navigator = () => {
return (
<NavigationContainer ref={navigationRef} theme={myTheme}>
<Stack.Navigator initialRouteName="Loader" mode="modal">
<Stack.Screen
name="Loader"
component={LoaderScreen}
options={{headerShown: false}}
/>
<Stack.Screen
name="Main"
component={MainScreen}
options={{headerShown: false}}
/>
<Stack.Screen
name="Player"
component={PlayerScreen}
options={{
headerShown: false,
gestureDirection: 'vertical',
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
export default Navigator;