forked from valora-inc/wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
47 lines (41 loc) · 1.59 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
// Order is important, please don't change it unless you know what you're doing :D
import 'node-libs-react-native/globals'
import 'src/missingGlobals'
import 'src/forceCommunityAsyncStorage'
import 'src/setupE2eEnv' // This is only for E2E tests and has no effects when not running E2E tests
if (__DEV__) {
import('./src/reactotronConfig').then(() => console.log('Reactotron Configured'))
}
import { AppRegistry } from 'react-native'
import Logger from 'src/utils/Logger'
// This needs to happen early so any errors (including in the store) get caught
import Config from 'react-native-config'
import { stringToBoolean } from '@celo/utils/lib/parsing'
import App from 'src/app/App'
import * as Sentry from '@sentry/react-native'
import 'react-native-gesture-handler'
import { Text, TextInput } from 'react-native'
const SENTRY_ENABLED = stringToBoolean(Config.SENTRY_ENABLED || 'false')
Logger.overrideConsoleLogs()
const defaultErrorHandler = ErrorUtils.getGlobalHandler()
const customErrorHandler = (e, isFatal) => {
if (SENTRY_ENABLED) {
Sentry.captureException(e)
}
Logger.error('RootErrorHandler', `Unhandled error. isFatal: ${isFatal}`, e)
defaultErrorHandler(e, isFatal)
}
ErrorUtils.setGlobalHandler(customErrorHandler)
// Prevent Text elements font from scaling over 2
Text.defaultProps = {
...Text.defaultProps,
maxFontSizeMultiplier: 2,
}
// Prevent TextInput font from scaling over 2
// Scale font to fit on TextInput elements
TextInput.defaultProps = {
...TextInput.defaultProps,
maxFontSizeMultiplier: 2,
adjustsFontSizeToFit: true,
}
AppRegistry.registerComponent('celo', () => App)