forked from ant-design/antd-mobile-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
40 lines (35 loc) · 934 Bytes
/
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
import { StackNavigator } from 'react-navigation';
import Home from './src/Home';
import RnIndex from './src/RnIndex';
import WebIndex from './src/WebIndex';
import { UIVIEWS, UICONTROLS, OTHERS, UIBARS } from './src/demoList';
const getOptions = title => ({
title,
headerStyle: {
backgroundColor: 'black',
},
headerTintColor: 'white',
});
const scenes = {
Home: {
screen: Home,
navigationOptions: getOptions('Ant Design Mobile'),
},
web: {
screen: WebIndex,
navigationOptions: getOptions('Antm Web Component'),
},
native: {
screen: RnIndex,
navigationOptions: getOptions('Antm React Native'),
},
};
[...UIVIEWS, ...UICONTROLS, ...OTHERS, ...UIBARS].map((component) => {
const Module = component.module.default;
scenes[component.title] = {
screen: Module,
navigationOptions: getOptions(component.title),
};
});
const App = StackNavigator(scenes);
export default App;