This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
238 lines (229 loc) · 5.66 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
import React from 'react';
import {Image} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator, TransitionPresets} from '@react-navigation/stack';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import Main from './src/pages/main';
import Login from './src/pages/login';
import Splash from './src/pages/splash';
import Inbox from './src/pages/inbox';
import Send from './src/pages/send';
import Mine from './src/pages/mine';
import Write from './src/pages/write';
import Detail from './src/pages/detail';
import Register from './src/pages/register';
import Admin from './src/pages/admin';
import Draft from './src/pages/draft';
import inboxIcon from './src/static/inbox.png';
import mineIcon from './src/static/mine.png';
const Stack = createStackNavigator();
const LoginStack = createStackNavigator();
const MainStack = createStackNavigator();
const MineStack = createStackNavigator();
const Tab = createBottomTabNavigator();
const App = () => {
return (
<NavigationContainer>
<Stack.Navigator>
{/* <Stack.Screen
name="LoginStack"
component={LoginStackComp}
options={{
headerShown: false,
}}
/> */}
<Stack.Screen
name="Splash"
component={Splash}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Login"
component={Login}
options={{
headerShown: false,
...TransitionPresets.FadeFromBottomAndroid,
}}
/>
<Stack.Screen
name="Register"
component={Register}
options={{
headerShown: false,
...TransitionPresets.FadeFromBottomAndroid,
}}
/>
<Stack.Screen
name="Write"
component={Write}
options={{
title: '写邮件',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<Stack.Screen
name="Tab"
component={TabComp}
options={{
headerShown: false,
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
// const LoginStackComp = () => {
// return (
// <LoginStack.Navigator>
// <LoginStack.Screen
// name="Splash"
// component={Splash}
// options={{
// headerShown: false,
// }}
// />
// <LoginStack.Screen
// name="Login"
// component={Login}
// options={{
// headerShown: false,
// ...TransitionPresets.FadeFromBottomAndroid,
// }}
// />
// </LoginStack.Navigator>
// );
// };
const MainStackComp = () => {
return (
<MainStack.Navigator>
<MainStack.Screen
name="Main"
component={Main}
options={{
title: '14Days',
headerLeft: null,
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<MainStack.Screen
name="Inbox"
component={Inbox}
options={{
title: '收件箱',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<MainStack.Screen
name="Draft"
component={Draft}
options={{
title: '草稿箱',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<MainStack.Screen
name="Detail"
component={Detail}
options={{
title: '邮件详情',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<MainStack.Screen
name="Send"
component={Send}
options={{
title: '已发送',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<MainStack.Screen
name="Admin"
component={Admin}
options={{
title: '管理用户',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
</MainStack.Navigator>
);
};
const MineStackComp = () => {
return (
<MineStack.Navigator>
<MineStack.Screen
name="Mine"
component={Mine}
options={{
title: '个人信息',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<MineStack.Screen
name="Admin"
component={Admin}
options={{
title: '管理用户',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
</MineStack.Navigator>
);
};
const TabComp = () => {
return (
<Tab.Navigator>
<Tab.Screen
name="MainStack"
component={MainStackComp}
options={{
title: '邮箱',
tabBarIcon: () => (
<Image source={inboxIcon} style={{width: 20, height: 20}} />
),
}}
/>
<Tab.Screen
name="MineStack"
component={MineStackComp}
options={{
title: '我的',
tabBarIcon: () => (
<Image source={mineIcon} style={{width: 20, height: 20}} />
),
}}
/>
</Tab.Navigator>
);
};
// GLOBAL.XMLHttpRequest = GLOBAL.originalXMLHttpRequest || GLOBAL.XMLHttpRequest;
export default App;