Repository navigation
Expand file tree
/
Copy pathApp.js
More file actions
62 lines (57 loc) · 1.8 KB
/
Copy pathApp.js
File metadata and controls
62 lines (57 loc) · 1.8 KB
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
import React, {Component} from 'react';
import {StatusBar} from 'react-native';
import {ThemeProvider} from 'react-native-elements';
import Allstations from './src/screens/allstations';
import Favorites from './src/screens/favorites';
import {NavigationContainer} from '@react-navigation/native';
import {createDrawerNavigator} from '@react-navigation/drawer';
import {RFValue} from 'react-native-responsive-fontsize';
const Drawer = createDrawerNavigator();
const theme = {
colors: {
primary: '#570091',
},
};
// Parts from https://reactnavigation.org/docs/drawer-based-navigation/
export default class App extends Component {
render() {
return (
<ThemeProvider theme={theme}>
<StatusBar
backgroundColor="#9900ff"
barStyle={'light-content'}
hidden={false}
/>
<NavigationContainer style={{fontSize: 50}}>
<Drawer.Navigator
drawerPosition="left"
initalRoutName="Not given"
backBehavior="none"
drawerType="front"
sceneContainerStyle=""
initialRouteName="Home"
drawerContentOptions={{
activeTintColor: '#570091',
labelStyle: {fontSize: RFValue(14), fontFamily: 'lucida grande'},
}}
drawerStyle={{
backgroundColor: '#ffffff',
marginTop: 100,
width: 240,
}}>
<Drawer.Screen
name="Home"
component={Allstations}
options={{drawerLabel: 'Home'}}
/>
<Drawer.Screen
name="Favorites"
component={Favorites}
options={{drawerLabel: 'Favorites'}}
/>
</Drawer.Navigator>
</NavigationContainer>
</ThemeProvider>
);
}
}