-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
185 lines (179 loc) · 5.15 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
import React from 'react';
import {
StyleSheet,
View,
Text,
TouchableOpacity,
TextInput,
ListView,
Alert,
Button,
RefreshControl,
Image,
ScrollView
} from 'react-native';
// Version can be specified in package.json
// import { Ionicons } from '@expo/vector-icons';
import {Header, Icon} from 'react-native-elements';
console.disableYellowBox = true;
import { StackNavigator, TabNavigator, TabBarBottom } from 'react-navigation';
import { createStackNavigator } from 'react-navigation';
import styles from './Components/Styles'
import RegisterScreen from './Components/RegisterScreen'
import LoginScreen from './Components/LoginScreen'
import ResultScreen from './Components/ResultScreen'
import GroceryListScreen from './Components/GroceryListScreen'
import HorizontalMealScroll from './Components/HorizontalMealScroll'
import SearchScreen from './Components/SearchScreen'
import CheckoutScreen from './Components/CheckoutScreen'
import FeedbackScreen from './Components/FeedbackScreen'
import CategoriesScreen from './Components/CategoriesScreen'
import CartScreen from './Components/CartScreen'
import HomeNavigator from './Components/HomeNavigator'
import CategoriesNavigator from './Components/CategoriesNavigator'
import SearchNavigator from './Components/SearchNavigator'
import AddressScreen from './Components/AddressScreen'
import ContactScreen from './Components/ContactScreen'
import ProductScreen from './Components/ProductScreen'
import UserOrder from './Components/OrderInfo'
// import Interface from './Components/Interface' why does import not work
import DrawerNavigator from './Components/DrawerNavigator'
const MainNavigator = StackNavigator({
Login: {
screen: LoginScreen,
navigationOptions: {
header: null,
}
},
Cart: {
screen: CartScreen
},
Register: {
screen: RegisterScreen,
},
Checkout: {
screen: CheckoutScreen,
headerMode:'screen',
navigationOption: {
headerVisible:true
}
},
Address: {
screen: AddressScreen
},
Contact: {
screen: ContactScreen
},
Feedback: {
screen: FeedbackScreen
},
Product: {
screen: ProductScreen
},
// Search:{
// screen:SearchScreen
// },//For testing
// SearchResults: {
// screen: SearchResultScreen
// },// For testing
AccountDetail: {
screen: UserOrder
},//For testing
Drawer: {
screen: DrawerNavigator,
navigationOptions: {
header: null,
}
},
},
{
headerMode: 'screen',
navigationOptions: {
},
initialRouteName: 'Login' //for debugging
})
export default class App extends React.Component {
render() {
return (
<View style={{ flex: 1 }}>
<MainNavigator />
</View>
);
}
}
// const screens = {
// Login: {
// screen: LoginScreen,
// },
// Register: {
// screen: RegisterScreen,
// },
// BrowseGrocery: {
// screen: BrowseGroceryScreen,
// },
// GroceryList: {
// screen: GroceryListScreen,
// },
// Search: {
// screen: SearchScreen,
// },
// Home: {
// screen: HomeScreen,
// },
// Checkout: {
// screen: CheckoutScreen,
// },
// Feedback: {
// screen: FeedbackScreen
// },
// Categories: {
// screen: CategoriesScreen
// }
// }
// const Home = StackNavigator(screens, {initialRouteName: 'Home'} )
// const Search = StackNavigator(screens,{initialRouteName: 'Search'} )
// const BrowseGrocery = StackNavigator(screens, {initialRouteName: 'BrowseGrocery'})
// const GroceryList = StackNavigator(screens, {initialRouteName: 'GroceryList'})
// const Categories = StackNavigator(screens, {initialRouteName: 'Categories'})
// export default TabNavigator(
// {
// Categories: { screen: Categories },
// Home: { screen: HomeScreen },
// Search: { screen: Search },
// BrowseGrocery: { screen: BrowseGrocery },
// GroceryList: { screen: GroceryList }
// },
// {
// // navigationOptions: ({ navigation }) => ({
// // tabBarIcon: ({ focused, tintColor }) => {
// // const { routeName } = navigation.state;
// // let iconName;
// // if (routeName === 'Home') {
// // iconName = `ios-information-circle${focused ? '' : '-outline'}`;
// // } else if (routeName === 'Search') {
// // iconName = `ios-options${focused ? '' : '-outline'}`;
// // }
// // else if (routeName === 'BrowseGrocery') {
// // iconName = `ios-options${focused ? '' : '-outline'}`;
// // }
// // else if (routeName === 'GroceryList') {
// // iconName = `ios-options${focused ? '' : '-outline'}`;
// // }
// //
// //
// // // You can return any component that you like here! We usually use an
// // // icon component from react-native-vector-icons
// // return <Ionicons name={iconName} size={25} color={tintColor} />;
// // },
// // }),
// // tabBarComponent: TabBarBottom,
// // tabBarPosition: 'bottom',
// // tabBarOptions: {
// // activeTintColor: 'tomato',
// // inactiveTintColor: 'gray',
// // },
// // animationEnabled: true,
// // swipeEnabled: false,
// order: ['Categories', 'Search', 'BrowseGrocery','GroceryList','Home']
// }
// );