-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
70 lines (63 loc) · 2.32 KB
/
App.js
File metadata and controls
70 lines (63 loc) · 2.32 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
import React from 'react';
import { Button, Text, View } from 'react-native';
import { Ionicons, AntDesign, MaterialCommunityIcons } from '@expo/vector-icons';
import { createStackNavigator, createBottomTabNavigator, createAppContainer } from 'react-navigation';
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
import WallScreen from './screens/WallScreen';
import IOTDScreen from './screens/IOTDScreen';
import ProfileScreen from './screens/ProfileScreen';
class DetailsScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Details!</Text>
</View>
);
}
}
const IOTDStack = createStackNavigator({
IOTD: {
screen: IOTDScreen,
navigationOptions: ({ navigation }) => ({
title: "Astrobin",
})},
Details: { screen: DetailsScreen },
});
const WallStack = createStackNavigator({
Wall: { screen: WallScreen },
Details: { screen: DetailsScreen },
});
const ProfileStack = createStackNavigator({
Profile: { screen: ProfileScreen },
Details: { screen: DetailsScreen },
});
const TabNavigator = createMaterialBottomTabNavigator(
{
IOTD: { screen: IOTDStack },
Wall: { screen: WallStack },
Profile: { screen: ProfileStack },
},
{
defaultNavigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, horizontal, tintColor }) => {
const { routeName } = navigation.state;
let IconComponent = Ionicons;
let iconName;
if (routeName === 'IOTD') {//color={focused ? 'grey' : 'black'
return <Ionicons name='ios-home' size={24} color={tintColor}/>
}
else if (routeName === 'Wall') {
return <Ionicons name='ios-photos' size={24} color={tintColor}/>
}
else if (routeName === 'Profile') {
return <MaterialCommunityIcons name='account-circle' size={24} color={tintColor} />
}
},
}),
initialRouteName: 'IOTD',
activeColor: 'black',
inactiveColor: 'grey',
barStyle: { backgroundColor: 'white' },
}
);
export default createAppContainer(TabNavigator);