-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
108 lines (103 loc) · 3.81 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
105
106
107
108
import * as React from 'react';
import { View, Text, Image } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Login from './src/screens/auth/Login';
import SplashScreen from './src/screens/intro/SplashScreen';
import Register from './src/screens/auth/Register';
import HomeScreen from './src/screens/tabs/HomeScreen';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import CartScreen from './src/screens/tabs/CartScreen';
import FavoritesScreen from './src/screens/tabs/FavoritesScreen';
import OrderScreen from './src/screens/tabs/OrderScreen';
import SettingScreen from './src/screens/SettingScreen';
import DetailScreen from './src/screens/DetailScreen';
import PaymentScreen from './src/screens/PaymentScreen';
import PersonScreen from './src/screens/PersonScreen';
const homeName = 'HomeScreen';
const cartScreen = 'CartScreen';
const favorScreen = 'FavoritesScreen';
const orderScreen = 'OrderScreen';
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
const App = () => {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName='SplashScreen' screenOptions={{headerShown: false}}>
<Stack.Screen name="SplashScreen" component={SplashScreen} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Register" component={Register} />
<Stack.Screen name="HomeScreen" component={MainContainer} />
<Stack.Screen name='SettingScreen' component={SettingScreen} />
<Stack.Screen name='DetailScreen' component={DetailScreen} />
<Stack.Screen name='PaymentScreen' component={PaymentScreen} />
<Stack.Screen name='PersonScreen' component={PersonScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
const MainContainer = () => {
return (
<Tab.Navigator
initialRouteName={homeName}
screenOptions={{
tabBarStyle: {backgroundColor: '#0C0F14', borderTopWidth: 0, height: 70},
tabBarActiveTintColor: '#D17842',
tabBarHideOnKeyboard: true,
tabBarLabel:()=> null}} >
<Tab.Screen
name={homeName}
component={HomeScreen}
options={{
headerShown: false,
tabBarIcon: ({focused}) => (
<Image
style={{height: 24, width: 24, tintColor: focused ? '#D17842' : undefined}}
source={require('./assets/images/home.png')}
/>
),
}}
/>
<Tab.Screen
name={cartScreen}
component={CartScreen}
options={{
headerShown: false,
tabBarIcon: ({focused}) => (
<Image
style={{height: 27, width: 24, tintColor: focused ? '#D17842' : undefined}}
source={require('./assets/images/cart.png')}
/>
),
}}
/>
<Tab.Screen
name={favorScreen}
component={FavoritesScreen}
options={{
headerShown: false,
tabBarIcon: ({focused}) => (
<Image
style={{height: 24, width: 27, tintColor: focused ? '#D17842' : undefined}}
source={require('./assets/images/favor.png')}
/>
),
}}
/>
<Tab.Screen
name={orderScreen}
component={OrderScreen}
options={{
headerShown: false,
tabBarIcon: ({focused}) => (
<Image
style={{height: 27, width: 22, tintColor: focused ? '#D17842' : undefined}}
source={require('./assets/images/order.png')}
/>
),
}}
/>
</Tab.Navigator>
);
};
export default App;