-
Notifications
You must be signed in to change notification settings - Fork 8
/
router.js
106 lines (97 loc) · 2.52 KB
/
router.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import {
createDrawerNavigator,
createStackNavigator,
StackActions,
NavigationActions,
DrawerItems
} from 'react-navigation';
import React from 'react';
import { Button, View, Text, StyleSheet, Image, SafeAreaView } from 'react-native';
import { fadeIn, zoomIn } from 'react-navigation-transitions';
import { Container, Icon, Content, Header, Body} from 'native-base'
import Expo, { Constants, Location, Permissions } from 'expo';
import MapScreen from './src/components/map/map.component';
import AddPinMap from './src/components/addpinmap/addpinmap.component';
import PinInfo from './src/components/pininfo/pininfo.component';
import SearchScreen from './src/components/search/search.component';
import MyPinsScreen from './src/components/mypins/mypins.component';
const CustomDrawerContentComponent = (props) => (
<SafeAreaView style = {{flex:1}}>
<Header style={styles.drawerHeader}>
<Body>
<Image
style={styles.drawerImage}
source={require('./assets/icon.png')} />
</Body>
</Header>
<Content>
<DrawerItems {...props} />
</Content>
</SafeAreaView>
);
const MapNav = createDrawerNavigator({
Search: {
screen: SearchScreen,
navigationOptions: {
drawerIcon: <Icon name = "search" style = {{fontSize: 24, color:'red'}} />
}
},
Map: {
screen: MapScreen,
navigationOptions: {
drawerIcon: <Icon name = "home" style = {{fontSize: 24, color: 'red'}} />,
header: null
}
},
MyPins: {
screen: MyPinsScreen,
navigationOptions: {
drawerIcon: <Icon name='ios-pin' style = {{color:'red'}} />
}
},
AddPin:{
screen: AddPinMap,
navigationOptions: {
drawerLabel: ()=>null
}
},
PinInfo: {
screen: PinInfo,
navigationOptions: {
drawerLabel: ()=>null
}
}
},
{
initialRouteName: 'Map',
transitionConfig: () => fadeIn(),
drawerPosition: 'left',
headerMode: 'screen',
contentComponent: CustomDrawerContentComponent,
contentOptions: {
activeTintColor: '#03a9f4',
inactiveTintColor: '#9e9e9e',
},
navigationOptions: {
header: null,
}
}, {});
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
drawerHeader: {
height: 200,
backgroundColor: 'white',
alignItems: 'center'
},
drawerImage: {
height: 150,
width: 150,
borderRadius: 75,
alignSelf: 'center'
}
});
export default MapNav;