-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
executable file
·46 lines (43 loc) · 1.24 KB
/
App.js
File metadata and controls
executable file
·46 lines (43 loc) · 1.24 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
import React from 'react';
import { Text } from 'react-native'
import firebase from 'react-native-firebase';
import Login from './app/pages/Login'
import AuthLoadingScreen from './app/pages/AuthLoadingScreen'
import Main from './app/pages/Main'
import Icon from 'react-native-vector-icons/FontAwesome'
import { createSwitchNavigator, createStackNavigator,
createBottomTabNavigator } from 'react-navigation';
const AuthStack = createStackNavigator({ login: Login });
const routeToIcon = {
"Dashboard": "pie-chart",
"Market": "line-chart",
"Exchange": "exchange",
"News": "newspaper-o",
"Orders": "ticket",
}
const AppStack = createBottomTabNavigator({
Market: Main,
Exchange: Main,
Dashboard: Main,
News: Main,
Orders: Main,
},{
initialRouteName: "Dashboard",
swipeEnabled: true,
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
console.log(focused, tintColor)
const iconName = routeToIcon[navigation.state.routeName]
return <Icon name={iconName} size={25} color={focused ? tintColor: "grey"} />
}})
})
export default createSwitchNavigator(
{
AuthLoading: AuthLoadingScreen,
App: AppStack,
Auth: AuthStack,
},
{
initialRouteName: 'AuthLoading',
}
);