-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
159 lines (151 loc) · 3.91 KB
/
App.js
File metadata and controls
159 lines (151 loc) · 3.91 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import React from 'react'
import {
StyleSheet,
View,
Text,
StatusBar,
TouchableOpacity
} from 'react-native'
import { NavigationContainer } from '@react-navigation/native'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import Icon from 'react-native-vector-icons/FontAwesome'
import Mapa from './screens/Screen1'
import Screen2 from './screens/Screen2'
import Screen5 from './screens/Screen5'
const Tab = createBottomTabNavigator()
const CustomTabBarButton = ({ children, onPress }) => (
<TouchableOpacity
style={{
top: -30,
justifyContent: 'center',
alignItems: 'center',
...styles.shadow
}}
onPress={onPress}
>
<View
style={{
top: 15,
width: 75,
height: 70,
borderRadius: 25,
backgroundColor: '#e32'
}}
>
{children}
</View>
</TouchableOpacity>
)
const App = () => {
return (
<>
<StatusBar barStyle={'light-content'} backgroundColor={'black'} />
<NavigationContainer>
<Tab.Navigator
initialRouteName="Post"
tabBarOptions={{
showLabel: false,
labelStyle: { fontSize: 18 },
activeTintColor: 'red',
inactiveTintColor: 'black',
style: {
position: 'absolute',
bottom: 25,
left: 80,
right: 80,
elevation: 0,
backgroundColor: 'rgba(255, 255, 255, 0.15)',
height: 65,
borderRadius: 20,
...styles.shadow
}
}}
>
<Tab.Screen
name="Home"
component={Screen2}
options={{
tabBarIcon: ({ focused }) => (
<View
style={{ alignItems: 'center', justifyContent: 'center' }}
>
<Icon
name="home"
size={30}
style={{
width: 30,
height: 30,
color: focused ? '#e32' : '#fff'
}}
/>
<Text
style={{ color: focused ? '#e32' : '#fff', fontSize: 12 }}
>
Home
</Text>
</View>
)
}}
/>
<Tab.Screen
name="Post"
component={Mapa}
options={() => ({
tabBarIcon: () => (
<Icon
name="search"
size={32}
style={{
width: 35,
height: 35,
color: '#FFF'
}}
/>
),
tabBarButton: (props) => <CustomTabBarButton {...props} />
})}
/>
<Tab.Screen
name="Notications"
component={Screen5}
options={{
tabBarIcon: ({ focused }) => (
<View
style={{ alignItems: 'center', justifyContent: 'center' }}
>
<Icon
name="gear"
size={30}
style={{
width: 30,
height: 30,
color: focused ? '#e32' : '#fff'
}}
/>
<Text
style={{ color: focused ? '#e32' : '#fff', fontSize: 12 }}
>
Settings
</Text>
</View>
)
}}
/>
</Tab.Navigator>
</NavigationContainer>
</>
)
}
export default App
const styles = StyleSheet.create({
shadow: {
shadowColor: '#7F5DF0',
shadowOffset: {
width: 0,
height: 10
},
shadowOpacity: 0.25,
shadowRadius: 4.5,
elevation: 4
}
})