-
Notifications
You must be signed in to change notification settings - Fork 137
/
App.js
121 lines (111 loc) · 3.21 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
import * as React from 'react'
import { Icon } from 'react-native-elements'
import { NavigationContainer } from '@react-navigation/native'
import { createStackNavigator } from '@react-navigation/stack'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import PropTypes from 'prop-types'
import Profile1 from './screens/Profile1'
import Profile2 from './screens/Profile2'
import Profile3 from './screens/Profile3'
import Setting1 from './screens/Setting1'
import Product1 from './screens/Product1'
import SettingOption1 from './screens/Setting1/Options'
const Setting1Stack = createStackNavigator()
function SettingsStackScreen() {
return (
<Setting1Stack.Navigator>
<Setting1Stack.Screen name="Settings" component={Setting1} />
<Setting1Stack.Screen name="Options" component={SettingOption1} />
</Setting1Stack.Navigator>
)
}
const Product1Stack = createStackNavigator()
function Product1StackScreen() {
return (
<Product1Stack.Navigator>
<Product1Stack.Screen name="Product" component={Product1} />
</Product1Stack.Navigator>
)
}
const Profile1Stack = createStackNavigator()
function Profile1StackScreen() {
return (
<Profile1Stack.Navigator
screenOptions={{
headerShown: false
}}
>
<Profile1Stack.Screen name="Profile" component={Profile1} />
</Profile1Stack.Navigator>
)
}
const Profile2Stack = createStackNavigator()
function Profile2StackScreen() {
return (
<Profile2Stack.Navigator
screenOptions={{
headerShown: false
}}
>
<Profile2Stack.Screen name="Profile" component={Profile2} />
</Profile2Stack.Navigator>
)
}
const Profile3Stack = createStackNavigator()
function Profile3StackScreen() {
return (
<Profile3Stack.Navigator
screenOptions={{
headerShown: false
}}
>
<Profile3Stack.Screen name="Profile" component={Profile3} />
</Profile3Stack.Navigator>
)
}
const Tab = createBottomTabNavigator()
const HomeIcon = ({ focused, tintColor }) => (
<Icon
name="lens"
type="material"
size={26}
color={focused ? '#adacac' : '#ededed'}
/>
)
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: props => <HomeIcon {...props}/>
})}
tabBarOptions={{
activeTintColor: 'tomato',
inactiveTintColor: 'gray',
showLabel: false,
showIcon: true,
indicatorStyle: {
backgroundColor: 'transparent',
},
labelStyle: {
fontSize: 12,
},
iconStyle: {
width: 30,
height: 30,
},
style: {
// backgroundColor: 'transparent',
justifyContent: 'center',
},
}}
>
<Tab.Screen name="Profile1" component={Profile1StackScreen} />
<Tab.Screen name="Profile2" component={Profile2StackScreen} />
<Tab.Screen name="Profile3" component={Profile3StackScreen} />
<Tab.Screen name="Product1" component={Product1StackScreen} />
<Tab.Screen name="Settings" component={SettingsStackScreen} />
</Tab.Navigator>
</NavigationContainer>
)
}