This repository has been archived by the owner on Nov 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
App.js
83 lines (76 loc) · 2.2 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
import React, {Component} from 'react';
import {Text, Platform} from 'react-native';
import {withTranslation} from 'react-i18next';
import {compose} from 'recompose';
import 'react-native-gesture-handler';
import NavigationService from './src/NavigationService';
import AppContainer from './src/RootStack';
import withLanguage from './src/Language';
import './src/store/chatStore';
import './src/store/messageStore';
import './src/store/optionStore';
import './src/store/superGroupStore';
import './src/store/basicGroupStore';
import './src/store/userStore';
import './src/store/localizationStore';
import './src/store/notificationStore';
import './src/store/fileStore';
import './src/store/applicationStore';
import './src/store/stickerStore';
import './src/store/instantViewStore';
if (__DEV__) {
const YellowBox = require('react-native/Libraries/YellowBox/YellowBox');
YellowBox.ignoreWarnings([
'Warning: componentWillReceiveProps',
'shouldComponentUpdate',
'Failed to',
'`-[RCTRootView cancelTouches]`',
// Hide warnings caused by React Native (https://github.com/facebook/react-native/issues/20841)
'Require cycle: node_modules/react-native/Libraries/Network/fetch.js',
]);
}
const setFontFamily = () => {
// Set a global font for Android
const defaultFontFamily = {
style: {
fontFamily: 'Roboto',
fontSize: 15,
},
};
const TextRender = Text.render;
const initialDefaultProps = Text.defaultProps;
Text.defaultProps = {
...initialDefaultProps,
...defaultFontFamily,
};
Text.render = function render(props, ...args) {
const oldProps = props;
let newProps = {...props, style: [defaultFontFamily.style, props.style]};
try {
return Reflect.apply(TextRender, this, [newProps, ...args]);
} finally {
newProps = oldProps;
}
};
};
if (Platform.OS === 'android') {
setFontFamily();
}
const enhance = compose(
withLanguage,
withTranslation(),
// withTheme,
// withStyles(styles, { withTheme: true })
);
class App extends Component {
render() {
return (
<AppContainer
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
);
}
}
export default enhance(App);