-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
87 lines (78 loc) · 2.4 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
import React, { Component } from "react"
import Ionicons from 'react-native-vector-icons/Ionicons'
import { TabNavigator, TabBarBottom, StackNavigator } from 'react-navigation'
import { Button, View } from 'react-native'
import { Root, Container, Header, Content, ActionSheet, Text } from "native-base"
import HomeScreen from './Home/HomeScreen'
import RankScreen from './Rank/RankScreen'
import ReviewScreen from './Review/ReviewScreen'
import KelistScreen from './Kelist/KelistScreen'
import SettingScreen from './Setting/SettingScreen'
console.disableYellowBox = true
const HomeStack = StackNavigator({
Home: { screen: HomeScreen },
})
const ReviewStack = StackNavigator({
Review: { screen: ReviewScreen },
})
const RankStack = StackNavigator({
Rank: { screen: RankScreen },
})
const KelistStack = StackNavigator({
Kelist: { screen: KelistScreen },
})
const SettingStack = StackNavigator({
Setting: { screen: SettingScreen },
})
const RootStack = TabNavigator(
{
Home: { screen: HomeStack },
Rank: { screen: RankStack },
Review: { screen: ReviewStack },
Kelist: { screen: KelistStack },
Setting: { screen: SettingStack },
},
{
initialRouteName: 'Home',
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
const { routeName } = navigation.state;
let iconName;
if (routeName === 'Home') {
iconName = `ios-water${focused ? '' : '-outline'}`;
} else if (routeName === 'Review') {
iconName = `ios-add-circle${focused ? '' : '-outline'}`;
} else if (routeName === 'Rank') {
iconName = `ios-pie${focused ? '' : '-outline'}`;
} else if (routeName === 'Kelist') {
iconName = `ios-list-box${focused ? '' : '-outline'}`;
} else if (routeName === 'Setting') {
iconName = `ios-contact${focused ? '' : '-outline'}`;
}
// can return any icon here
return <Ionicons name={iconName} size={30} color={tintColor} />;
},
}),
tabBarOptions: {
activeTintColor: '#65C0D3',
inactiveTintColor: 'gray',
showLabel: true,
style: {
marginBottom: 2
}
},
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
animationEnabled: false,
swipeEnabled: true,
}
);
export default class App extends Component {
render() {
return (
<Root>
<RootStack />
</Root>
)
}
}