-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
56 lines (46 loc) · 2.1 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
import 'react-native-gesture-handler';
import SplashScreen from 'react-native-splash-screen';
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator, CardStyleInterpolators } from '@react-navigation/stack';
import { Platform } from 'react-native';
import { StatusBar } from 'expo-status-bar';
import DestinationPicker from './components/DestinationPicker';
import NextSchedule from './components/NextSchedule';
import OfflineModeInfo from './components/OfflineModeInfo';
import Lang from './includes/Lang';
const Stack = createStackNavigator();
export default function App() {
if (SplashScreen !== null) {
try {
SplashScreen.hide();
} catch (exception) {
console.warn('SplashScreen.hide():', exception);
}
}
return (
<>
<StatusBar style="light" />
<NavigationContainer>
<Stack.Navigator screenOptions={{
cardStyle: {
backgroundColor: 'black',
paddingHorizontal: Platform.constants.uiMode === 'watch' ? 0 : 8,
},
headerShown: Platform.constants.uiMode !== 'watch',
gestureEnabled: true,
headerStyle: { backgroundColor: 'black' },
headerShadowVisible: false,
headerTintColor: 'white',
headerTitleAlign: 'center',
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
// gestureDirection: 'horizontal-inverted' // disabled on production builds, can be used to test the gesture handler on Expo Go on a WearOS device
}}>
<Stack.Screen name='DestinationPicker' component={DestinationPicker} options={{ title: Lang.t('screenDestinationPickerName') }}></Stack.Screen>
<Stack.Screen name='NextSchedule' component={NextSchedule} options={{ title: Lang.t('screenNextScheduleName') }}></Stack.Screen>
<Stack.Screen name='OfflineModeInfo' component={OfflineModeInfo} options={{ title: Lang.t('screenOfflineModeInfoName') }}></Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
</>
);
}