-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
104 lines (98 loc) · 3.22 KB
/
App.tsx
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from 'react';
import CategoriesList from './screens/CategoriesList';
import {StatusBar, StyleSheet, Text, View} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import MyMealOverViewMeal from './screens/MyMealOverView';
import MealDetailScreen from './screens/MealDetailsScreen';
import {createDrawerNavigator} from '@react-navigation/drawer';
import FavouriteScreen from './screens/FavouriteScreen';
import Icon from 'react-native-vector-icons/Ionicons';
import {store} from './store/redux/store';
import {Provider} from 'react-redux';
const Stack = createNativeStackNavigator();
const Drawer = createDrawerNavigator();
function DrawerNavigator() {
return (
<Drawer.Navigator
screenOptions={{
headerStyle: {backgroundColor: '#351401'},
headerTintColor: 'white',
sceneContainerStyle: {backgroundColor: '#3f2f25'},
drawerContentStyle: {backgroundColor: '#351401'},
drawerActiveBackgroundColor: '#e4baa1',
drawerActiveTintColor: '#351401',
drawerInactiveTintColor: 'white',
}}>
<Drawer.Screen
name="Categories"
component={CategoriesList}
options={{
title: 'All Category',
drawerIcon: ({color, size}) => (
<Icon name="list" color={color} size={size} />
),
}}></Drawer.Screen>
<Drawer.Screen
name="Favourites"
component={FavouriteScreen}
options={{
drawerIcon: ({color, size}) => (
<Icon name="star" color={color} size={size} />
),
}}></Drawer.Screen>
</Drawer.Navigator>
);
}
function App() {
return (
<>
<StatusBar barStyle={'light-content'} backgroundColor={'#351401'} />
<View style={{flex: 1, backgroundColor: '#24180f'}}>
{/* <FavouriteContextPerovider> */}
<Provider store={store}>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerStyle: {backgroundColor: '#351401'},
headerTintColor: 'white',
contentStyle: {backgroundColor: '#3f2f25'},
}}>
<Stack.Screen
name="Drawer"
component={DrawerNavigator}
options={{headerShown: false}}
/>
<Stack.Screen
name="MealOverview"
component={MyMealOverViewMeal}
// options={({route, navigation}) => {
// const catId = route.params.categoryID;
// return {
// title: catId,
// };
// }}
/>
<Stack.Screen
name="MealDetails"
component={MealDetailScreen}
options={{
title: 'About the meal',
}}
/>
</Stack.Navigator>
</NavigationContainer>
</Provider>
{/* </FavouriteContextPerovider> */}
</View>
</>
);
}
const styles = StyleSheet.create({});
export default App;