-
Notifications
You must be signed in to change notification settings - Fork 10
/
App.js
232 lines (210 loc) · 4.67 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
import React, { Component } from 'react';
import { StackNavigator, TabNavigator } from 'react-navigation';
import { Icon } from 'native-base';
import { StyleSheet } from 'react-native';
//Importing the pages for navigation
import HomeScreen from './pages/home';
import DetailsScreen from './pages/details';
import LocationScreen from './pages/location';
import TrendScreen from './pages/trend';
import AboutScreen from './pages/about';
import ImageViewScreen from './pages/imageview';
import LoginScreen from './pages/login';
import MenuScreen from './pages/menu';
import ListScreen from './pages/list';
import OrderScreen from './pages/order';
import EditScreen from './pages/edit';
import SearchScreen from './pages/search';
//Custom Bottom Navigation Bar
import BottomNav from './Compoents/BottomNav';
//Database initialization
import './database/database';
import SplashScreen from 'react-native-smart-splash-screen'
//Initialize the Config
global.config = 1;
//List of Tabs in Bottom navigation bar
const tabList = [
{
title: "Home",
Icon: "ios-home-outline",
Select: "ios-home",
},
{
title: "Trend",
Icon: "ios-trending-up-outline",
Select: "md-trending-up",
},
{
title: "Location",
Icon: "ios-compass-outline",
Select: "ios-compass",
},
{
title: "About Us",
Icon: "ios-information-circle-outline",
Select: "ios-information-circle",
},
]
const tabBarConfiguration = {
tabBarOptions: {
style: {
backgroundColor: 'white',
borderTopWidth: 0,
shadowColor: '#000',
shadowOffset: { width: 0, height: 3 },
shadowOpacity: 0.2,
shadowRadius: 4,
elevation: 2,
},
},
tabBarPosition: 'bottom',
tabBarComponent: BottomNav,
swipeEnabled: false,
};
const HomeStack = StackNavigator({
Home: {
screen: HomeScreen,
},
Details: {
screen: DetailsScreen,
},
Imageview: {
screen: ImageViewScreen,
},
Login: {
screen: LoginScreen,
},
Menu: {
screen: MenuScreen,
},
List: {
screen: ListScreen,
},
Order: {
screen: OrderScreen,
},
Edit: {
screen: EditScreen,
},
Search: {
screen: SearchScreen,
}
});
const TrendStack = StackNavigator({
Trend: {
screen: TrendScreen,
},
Details: {
screen: DetailsScreen,
},
Imageview: {
screen: ImageViewScreen,
},
Login: {
screen: LoginScreen,
},
Menu: {
screen: MenuScreen,
},
List: {
screen: ListScreen,
},
Order: {
screen: OrderScreen,
},
Edit: {
screen: EditScreen,
}
});
const LocationStack = StackNavigator({
Location: {
screen: LocationScreen,
},
Menu: {
screen: MenuScreen,
},
List: {
screen: ListScreen,
},
Edit: {
screen: EditScreen,
}
});
const AboutStack = StackNavigator({
About: {
screen: AboutScreen,
},
Menu: {
screen: MenuScreen,
},
List: {
screen: ListScreen,
},
Edit: {
screen: EditScreen,
}
});
const RootStack = TabNavigator(
{
home: {
screen: HomeStack,
navigationOptions: {
tabBarLabel: tabList[0].title,
tabBarIcon: ({ focused, tintColor }) => (
<Icon name={focused? tabList[0].Select: tabList[0].Icon} style={[styles.centerit, focused ? {color: 'blue'}: {color: 'gray'}]} />
)
}
},
trend: {
screen: TrendStack,
navigationOptions: {
tabBarLabel: tabList[1].title,
tabBarIcon: ({ focused, tintColor }) => (
<Icon name={focused? tabList[1].Select: tabList[1].Icon} style={[styles.centerit, focused ? {color: 'blue'}: {color: 'gray'}]} />
)
}
},
location: {
screen: LocationStack,
navigationOptions: {
tabBarLabel: tabList[2].title,
tabBarIcon: ({ focused, tintColor }) => (
<Icon name={focused? tabList[2].Select: tabList[2].Icon} style={[styles.centerit, focused ? {color: 'blue'}: {color: 'gray'}]} />
)
}
},
about: {
screen: AboutStack,
navigationOptions: {
tabBarLabel: tabList[3].title,
tabBarIcon: ({ focused, tintColor }) => (
<Icon name={focused? tabList[3].Select: tabList[3].Icon} style={[styles.centerit, focused ? {color: 'blue'}: {color: 'gray'}]} />
)
}
}
}, tabBarConfiguration);
export default class App extends React.Component {
constructor(props){
super(props);
}
componentDidMount () {
SplashScreen.close({
animationType: SplashScreen.animationType.scale,
duration: 350,
delay: 0,
})
}
render() {
return (
<RootStack />
);
}
}
const styles = StyleSheet.create({
centerit: {
color: "#443f3f",
alignSelf: 'center',
fontSize: 20,
fontWeight: '700',
},
});