-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
96 lines (85 loc) · 2.32 KB
/
App.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
/****************************************************************************
* Imports, variables, constants
***************************************************************************/
// ReactNative and external dependencies
import React, { Component } from 'react';
import { Platform } from 'react-native';
import { Icon } from 'native-base';
import { createAppContainer, createSwitchNavigator, createBottomTabNavigator } from 'react-navigation';
// Screens
import AuthLoadingScreen from '@screens/Auth/AuthLoadingScreen';
import AuthScreen from '@screens/Auth/AuthScreen';
import HomeScreen from '@screens/App/HomeScreen';
import SettingsScreen from '@screens/App/SettingsScreen';
/****************************************************************************
* App component
***************************************************************************/
/**
*
*/
export default class App extends Component {
render() {
return (
<MainContainer />
);
}
}
/****************************************************************************
* Navigators
***************************************************************************/
/**
* Application navigator containing the main options
*/
const AppNavigator = createBottomTabNavigator({
// First button
Home: {
screen: HomeScreen,
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ tintColor }) => (
<Icon name='home' type='AntDesign' style={{ color: tintColor }} />
)
})
},
// Second button
Settings: {
screen: SettingsScreen,
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ tintColor }) => (
<Icon name='setting' type='AntDesign' style={{ color: tintColor }} />
)
})
}
},
{
animationEnabled: true,
swipeEnabled: true,
tabBarPosition: "bottom",
tabBarOptions: {
style: {
...Platform.select({
android: {
backgroundColor: 'white'
}
})
},
activeTintColor: 'blue',
inactiveTintColor: '#000000',
showLabel: false,
showIcon: true
}
});
/**
* Authentication navigator
*/
const AuthNavigator = createSwitchNavigator({
AuthLoading: AuthLoadingScreen,
Auth: AuthScreen,
App: AppNavigator
},
{
initialRouteName: 'AuthLoading'
});
/**
* Main container
*/
const MainContainer = createAppContainer(AuthNavigator);