-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
39 lines (35 loc) · 1.16 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
import React, { useContext } from 'react';
import { createStackNavigator, createAppContainer } from 'react-navigation';
import Storija from './src/vendors/storija.json';
import HomeScreen from './src/components/HomeScreen';
import VendorMenuScreen from './src/components/VendorMenuScreen';
import CondimentsScreen from './src/components/CondimentsScreen';
import VendorContext from './src/VendorContext';
import { headerColor } from './src/styles';
import transitionConfig from './src/transitionConfiguration';
const AppNavigator = createStackNavigator(
{
Home: { screen: HomeScreen },
VendorMenu: { screen: VendorMenuScreen },
Condiments: { screen: CondimentsScreen },
},
{
transitionConfig,
initialRouteName: 'Home',
defaultNavigationOptions: {
headerStyle: {
backgroundColor: headerColor,
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
},
},
);
const AppContainer = createAppContainer(AppNavigator);
export default function App({ vendors }) {
const vendorContext = useContext(VendorContext);
vendorContext.vendors = vendors || [Storija];
return <AppContainer />;
}