-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnavigation.js
More file actions
82 lines (77 loc) · 3.06 KB
/
navigation.js
File metadata and controls
82 lines (77 loc) · 3.06 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import React, { Component } from 'react';
import { createBottomTabNavigator, createStackNavigator, createTopTabNavigator } from 'react-navigation';
import CardStackStyleInterpolator from "react-navigation/src/views/StackView/StackViewStyleInterpolator";
import { Entypo, FontAwesome, MaterialIcons } from '@expo/vector-icons';
import PorfolioScreen from './screens/PortfolioScreen';
import SettingsScreen from './screens/SettingsScreen';
import WatchlistScreen from './screens/WatchlistScreen';
import TransactionScreen from './screens/TranscationScreen';
import ExchangeListScreen from './screens/ExchangeListScreen';
import TradingPairListScreen from './screens/TradingPairListScreen';
import ManageCoinScreen from './screens/ManageCoinScreen';
import SearchCoinsScreen from './screens/SearchCoinsScreen';
export const MainNavigator = createBottomTabNavigator({
portfolio: {
screen: createStackNavigator( {
portfolio: { screen: PorfolioScreen },
searchcoins: { screen: SearchCoinsScreen },
managecoin: { screen: ManageCoinScreen },
transaction: {screen: TransactionScreen},
exchanges: {screen: ExchangeListScreen},
tradingPairs: {screen: TradingPairListScreen}
},
{
//TransitionConfig Changes Stack Navigation from Right to Left in Android
//to be consistent with IOS Transition
transitionConfig: () => ({
screenInterpolator: sceneProps => {
const { layout, position, scene } = sceneProps;
const { index } = scene;
const translateX = position.interpolate({
inputRange: [index - 1, index, index + 1],
outputRange: [layout.initWidth, 0, 0]
});
const opacity = position.interpolate({
inputRange: [index - 1, index - 0.99, index, index + 0.99, index + 1],
outputRange: [0, 1, 1, 0.3, 0]
});
return { opacity, transform: [{ translateX }] }
}
}),
}
)
},
// watchlist: {
// screen: createStackNavigator({
// watchlist: { screen: WatchlistScreen},
// searchcoins: { screen: SearchCoinsScreen }
// }),
// }
// settings: { screen: SettingsScreen },
},
{
// navigationOptions: ({ navigation }) => ({
// tabBarIcon: ({tintColor }) => {
// const { routeName } = navigation.state;
// let iconName;
// let size = 25;
// if (routeName === 'portfolio') {
// return <Entypo name='wallet' size={size} color={tintColor} />;
// } else if (routeName === 'settings') {
// return <MaterialIcons name='settings' size={size} color={tintColor} />;
// }
// else if (routeName === 'watchlist') {
// return <FontAwesome name='binoculars' size={size} color={tintColor} />;
// }
// },
// }),
swipeEnabled: false,
tabBarOptions: {
showLabel: false,
activeTintColor: '#fff',
style: {
backgroundColor: '#282e33'
}
}
}
)