-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.js
95 lines (91 loc) · 2.25 KB
/
routes.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
import { StackNavigator, TabNavigator, TabBarBottom } from 'react-navigation';
import React, { Component } from 'react';
import { Animated, Easing } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
//importing screens from react-native
import HomeScreen from './Screens/HomeScreen';
import LocationScreen from './Screens/LocationsScreen';
import OverviewScreen from './Screens/Overview';
import SettingsScreen from './Screens/SettingsScreen';
import DayForecastScreen from './Screens/SpecificDay';
const HomeStack = StackNavigator(
{
Home: {
screen: HomeScreen,
navigationOptions: {
header: null
}
},
Specific: {
screen: DayForecastScreen,
navigationOptions: {
headerTitle: 'Today'
}
}
},
{
mode: 'modal',
headerMode: 'float'
/* transitionConfig: () => ({
transitionSpec: {
duration: 400,
timing: Animated.timing,
easing: Easing.step0
}
}) */
}
);
export default TabNavigator(
{
Home: {
screen: HomeStack,
navigationOptions: {
title: 'Today'
}
},
Overview: { screen: OverviewScreen },
Location: {
screen: LocationScreen,
navigationOptions: {
title: 'Places'
}
},
Settings: { screen: SettingsScreen }
},
{
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
const { routeName } = navigation.state;
let iconName;
if (routeName === 'Home') {
iconName = `ios-home${focused ? '' : '-outline'}`;
} else if (routeName === 'Location') {
iconName = `ios-compass${focused ? '' : '-outline'}`;
} else if (routeName === 'Overview') {
iconName = `ios-pulse`;
} else if (routeName === 'Settings') {
iconName = `ios-settings${focused ? '' : '-outline'}`;
}
// You can return any component that you like here! We usually use an
// icon component from react-native-vector-icons
return <Ionicons name={iconName} size={25} color={tintColor} />;
}
}),
tabBarOptions: {
activeTintColor: '#2874F0',
inactiveTintColor: '#2874F0',
activeBackgroundColor: '#cde1f9',
labelStyle: {
fontSize: 0
},
style: {
backgroundColor: 'white',
height: 55
}
},
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
animationEnabled: false,
swipeEnabled: false
}
);