-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
95 lines (70 loc) · 2.21 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
import React, {Component} from 'react';
import {Text, View, ToolbarAndroid, StyleSheet} from 'react-native';
import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import {createBottomTabNavigator} from 'react-navigation-tabs';
import Ionicons from 'react-native-vector-icons/Ionicons';
import MainScreen from './components/MainScreen';
import Posts from './components/Posts';
import ViewPost from './components/pages/ViewPost';
import HomeScreen from './components/pages/HomeScreen';
import SettingsScreen from './components/pages/SettingsScreen';
import DetailsScreen from './components/pages/DetailsScreen';
import ProfileScreen from './components/pages/ProfileScreen';
import NewPost from './components/pages/NewPost';
const HomeStack = createStackNavigator(
{
Home: { screen: MainScreen },
ViewPost: { screen: ViewPost },
},
{
defaultNavigationOptions: {
//Header customization of the perticular Screen
header: null,
headerLeft: null,
gesturesEnabled: false,
//Header title
},
}
);
const App = createBottomTabNavigator(
{
Home: { screen: HomeStack },
NewPost: { screen: NewPost },
Profile: {screen: ProfileScreen}
},
{
defaultNavigationOptions: ({ navigation }) => ({
header: null,
tabBarIcon: ({ focused, horizontal, tintColor }) => {
const { routeName } = navigation.state;
let IconComponent = Ionicons;
let iconName;
if (routeName === 'Home') {
iconName = `ios-information-circle${focused ? '' : '-outline'}`;
} else if (routeName === 'NewPost') {
iconName = `ios-add-circle${focused ? '' : '-outline'}`;
}
else if(routeName === 'Profile'){
iconName = `ios-switch`;
}
return <IconComponent name={iconName} size={25} color={tintColor} />;
},
}),
tabBarOptions: {
style:{
elevation: 5,
backgroundColor: '#000000'
},
activeTintColor: '#a1887f',
inactiveTintColor: 'gray',
},
}
);
const styles = StyleSheet.create({
title: {
flex: 1,
elevation: 10,
},
});
export default createAppContainer(App);