-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
52 lines (45 loc) · 1.69 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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Ionicons from 'react-native-vector-icons/Ionicons';
import Home from './components/Home';
import Page2 from './components/Page2';
import ImgPicker from './components/ImgPicker';
import Notifiche from './components/NotificationView';
const Tab = createBottomTabNavigator();
export default class App extends React.Component {
render() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Home') {
iconName = focused
? 'ios-home'
: 'ios-home';
}
else if(route.name === 'Page2') {
iconName = focused ? 'ios-newspaper' : 'ios-newspaper';
}
else if(route.name === 'Immagine') {
iconName = focused ? 'ios-image' : 'ios-image';
}
return <Ionicons name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: '#004489',
inactiveTintColor: 'gray',
}}
>
<Tab.Screen name="Home" component={Home} />
{/* <Tab.Screen name="Page2" component={Page2} /> */}
<Tab.Screen name="Page2" component={Notifiche} />
<Tab.Screen name="Immagine" component={ImgPicker} />
</Tab.Navigator>
</NavigationContainer>
);
}
}