-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
92 lines (79 loc) · 2.87 KB
/
App.js
File metadata and controls
92 lines (79 loc) · 2.87 KB
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
import * as React from 'react';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import PinkScreen from "./src/screens/PinkScreen";
import PurpleScreen from "./src/screens/PurpleScreen";
import GreenScreen from "./src/screens/GreenScreen";
import BlueScreen from "./src/screens/BlueScreen";
import YellowScreen from "./src/screens/YellowScreen";
import DodgerBlueScreen from "./src/screens/DodgerBlueScreen";
import BrownScreen from "./src/screens/BrownScreen";
import {colors} from './src/utils/colors'
import { Image } from 'react-native';
const Drawer = createDrawerNavigator();
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
const TabScreens = () => {
return(
<Tab.Navigator screenOptions={({route}) => ({
tabBarIcon: ({focused}) => {
let icon;
if (route.name === 'DodgerBlueScreen') {
icon = focused
? require('./src/assets/blueeye.png')
: require('./src/assets/eye.png');
} else if (route.name === 'BrownScreen') {
icon = focused
? require('./src/assets/blueeye.png')
: require('./src/assets/eye.png');
}
// You can return any component that you like here!
return <Image style={{width: 35, height: 35}} source={icon} />
},
tabBarActiveBackgroundColor: colors.aqua,
tabBarInactiveBackgroundColor:'lightgrey',
headerShown: false,
tabBarShowLabel: true,
})}>
<Tab.Screen name="DodgerBlueScreen" component={DodgerBlueScreen} />
<Tab.Screen name="BrownScreen" component={BrownScreen} />
</Tab.Navigator>
)
}
const StackScreens = () => {
return(
<Stack.Navigator screenOptions={{headerShown:false}} >
<Stack.Screen name="GreenScreen" component={GreenScreen} />
<Stack.Screen name="BlueScreen" component={BlueScreen} />
<Stack.Screen name="YellowScreen" component={YellowScreen} />
</Stack.Navigator>
)
}
const App = () => {
return (
<NavigationContainer>
<Drawer.Navigator
initialRouteName="PinkScreen"
screenOptions={{
drawerStyle:{
backgroundColor: colors.lightgrey
} ,
drawerActiveTintColor: colors.orange ,
headerTintColor: colors.white,
headerStyle:{
backgroundColor:colors.lightgrey
},
drawerContentStyle:{}
}}
>
<Drawer.Screen name="PinkScreen" component={PinkScreen} />
<Drawer.Screen name="PurpleScreen" component={PurpleScreen} />
<Drawer.Screen name="Stack Screen" component={StackScreens} />
<Drawer.Screen name= "Tab Screen" component={TabScreens} />
</Drawer.Navigator>
</NavigationContainer>
);
}
export default App;