-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
105 lines (95 loc) · 2.76 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
import React from 'react';
// import { Button, Text, View } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { createStackNavigator, createBottomTabNavigator, createAppContainer } from 'react-navigation';
import Login from './App/components/Login'
// import HomeScreen from './App/components/HomeScreen'
import Register from './App/components/Register'
// import Add from './App/components/Add'
import NotificationDetail from './App/components/NotificationDetail'
import Notification from './App/components/Notification'
import Commont from './App/components/Commont'
import Questionnaire from './App/components/Questionnaire'
import SettingsScreen from './App/components/SettingsScreen'
// import learning from './App/components/learning'
// import { createAppContainer, createStackNavigator, createBottomTabNavigator} from 'react-navigation';
const HomeStack = createStackNavigator({
Notification:{
screen: Notification,
navigationOptions:()=>{//设置标题
return {
headerTitle:'通知',
headerTitleStyle:{color:'black'}
}
}
},
NotificationDetail:{
screen: NotificationDetail,
navigationOptions:()=>{//设置标题
return {
headerTitle:'详情',
headerTitleStyle:{color:'black'}
}
}
},
Questionnaire:{
screen:Questionnaire,
navigationOptions:()=>{
return {
headerTitle:'问卷调查'
}
}
},
Commont:{
screen:Commont,
navigationOptions:()=>{
return {
headerTitle:'评论',
headerTitleStyle:{
color:'black'
}
}
}
}
})
const SettingsStack = createStackNavigator({
SettingsScreen:{
screen:SettingsScreen,
navigationOptions:()=>{//设置标题
return {
headerTitle:'设置',
headerTitleStyle:{color:'black'}
}
}
},
Login: {
screen: Login,
},
Register: {
screen: Register,
},
})
const AppNavigator = createBottomTabNavigator({
Home: { screen: HomeStack },
Settings: { screen: SettingsStack },
}, {
defaultNavigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
const { routeName } = navigation.state;
let iconName;
if (routeName === 'Home') {
iconName = `ios-information-circle${focused ? '' : '-outline'}`;
} else if (routeName === 'Settings') {
iconName = `ios-options${focused ? '' : ''}`;
}
// You can return any component that you like here! We usually use an
// icon component from react-native-vector-icons
return <Ionicons name={iconName} size={25} color={tintColor} />;
},
}),
tabBarOptions: {
activeTintColor: 'tomato',
inactiveTintColor: 'gray',
},
});
export default createAppContainer(AppNavigator);