-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
150 lines (137 loc) · 4.01 KB
/
index.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
import React from 'react';
import {
AppRegistry,
UIManager,
AsyncStorage,
Platform,
YellowBox,
} from 'react-native';
import { autoRehydrate, persistStore } from 'redux-persist';
import { Sentry } from 'react-native-sentry';
import Orientation from 'react-native-orientation';
import { setCustomText, setCustomTextInput } from 'react-native-global-props';
import moment from 'moment';
import 'moment/locale/zh-cn';
import './app/utils/sensor';
import dva from './app/utils/dva';
import Router, { routerMiddleware, routerReducer } from './app/router';
import loginModel from './app/models/login';
import appModel from './app/models/app';
import fundModel from './app/models/fund';
import globalModel from './app/models/global';
import portfolioModel from './app/models/portfolio';
import userModel from './app/models/user';
import codepushModel from './app/models/codepush';
import resourceModel from './app/models/resource';
import colleagueModel from './app/models/colleague';
import notificationModel from './app/models/notification';
import recommendationModel from './app/models/recommendation';
import publicProjectModel from './app/models/public_project';
import institutionModel from './app/models/institution';
import newsModel from './app/models/news';
import favoredModel from './app/models/favored';
import activityModel from './app/models/activity';
import coinSetsModel from './app/models/coinSets';
import filterModel from './app/models/filter';
import serviceModel from './app/models/service';
import projectCreateModel from './app/models/project_create';
import institutionCreateModel from './app/models/institution_create';
import updateModel from './app/models/update';
import bannerModel from './app/models/banners';
import hotnodeIndexModel from './app/models/hotnode_index';
import globalSearchModel from './app/models/globalSearch';
import investNewsModel from './app/models/investNews';
import messageCenterModel from './app/models/message_center';
import rankModel from './app/models/rank';
import DappModel from './app/models/dapp';
import ProfileModel from './app/models/profile';
import YellowPageModel from './app/models/yellowpage';
YellowBox.ignoreWarnings([
'Warning: isMounted(...) is deprecated',
'Module RCTImageLoader',
]);
export const app = dva({
initialState: {},
models: [
loginModel,
appModel,
globalModel,
fundModel,
portfolioModel,
userModel,
codepushModel,
resourceModel,
colleagueModel,
notificationModel,
recommendationModel,
publicProjectModel,
institutionModel,
newsModel,
favoredModel,
activityModel,
coinSetsModel,
filterModel,
serviceModel,
projectCreateModel,
institutionCreateModel,
updateModel,
bannerModel,
hotnodeIndexModel,
globalSearchModel,
investNewsModel,
messageCenterModel,
rankModel,
DappModel,
ProfileModel,
YellowPageModel,
],
extraReducers: { router: routerReducer },
onAction: [routerMiddleware],
extraEnhancers: [autoRehydrate()],
});
export const persist = callback => {
persistStore(
app._store,
{
storage: AsyncStorage,
whitelist: [
'login',
'global',
'codePush',
'fund',
'user',
'institution',
'notification',
'news',
'project_create',
'institution_create',
'banners',
'message_center',
'dapp',
],
},
callback,
);
};
const App = app.start(<Router store={app._store} />);
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
Orientation.lockToPortrait();
moment.locale('zh-cn');
if (!global.__DEV__) {
Sentry.config(
'https://[email protected]/1234872',
).install();
}
setCustomText({
style: {
fontFamily: Platform.OS === 'ios' ? 'PingFangSC-Regular' : 'Roboto',
},
allowFontScaling: false,
});
setCustomTextInput({
allowFontScaling: false,
});
AppRegistry.registerComponent('nodecap', () => App);
export default app._store;