1
1
import React , { createRef , useEffect } from 'react' ;
2
2
import { LogBox , Platform , useColorScheme } from 'react-native' ;
3
3
4
+ import * as Sentry from '@sentry/react-native' ;
5
+ import Config from 'react-native-config' ;
6
+
7
+ if ( ! __DEV__ ) {
8
+ Sentry . init ( {
9
+ dsn : Config . SENTRY_DSN ,
10
+ } ) ;
11
+ }
12
+
13
+ import axios from 'axios' ;
14
+ import { defaultHeaders } from './utils/headers' ;
15
+
16
+ for ( const [ key , value ] of Object . entries ( defaultHeaders ( ) ) ) {
17
+ axios . defaults . headers . common [ key ] = value ;
18
+ }
19
+
4
20
import { NativeBaseProvider } from 'native-base' ;
5
21
import tracker from './analytics/Tracker' ;
6
22
@@ -15,29 +31,8 @@ import { I18nextProvider } from 'react-i18next';
15
31
import { Provider } from 'react-redux' ;
16
32
import { PersistGate } from 'redux-persist/integration/react' ;
17
33
18
- import axios from 'axios' ;
19
- import VersionNumber from 'react-native-version-number' ;
20
-
21
34
import KeyboardManager from 'react-native-keyboard-manager' ;
22
35
23
- import * as Sentry from '@sentry/react-native' ;
24
- import Config from 'react-native-config' ;
25
-
26
- if ( ! __DEV__ ) {
27
- Sentry . init ( {
28
- dsn : Config . SENTRY_DSN ,
29
- } ) ;
30
- }
31
-
32
- if ( Platform . OS === 'ios' ) {
33
- KeyboardManager . setEnable ( false ) ;
34
- KeyboardManager . setEnableAutoToolbar ( false ) ;
35
- KeyboardManager . setToolbarPreviousNextButtonEnable ( false ) ;
36
- }
37
-
38
- axios . defaults . headers . common [ 'X-CoopCycle-App-Version' ] =
39
- VersionNumber . appVersion ;
40
-
41
36
// import i18n first
42
37
import i18n from './i18n' ;
43
38
@@ -67,6 +62,12 @@ import {
67
62
navigationContainerOnReady ,
68
63
} from './Datadog' ;
69
64
65
+ if ( Platform . OS === 'ios' ) {
66
+ KeyboardManager . setEnable ( false ) ;
67
+ KeyboardManager . setEnableAutoToolbar ( false ) ;
68
+ KeyboardManager . setToolbarPreviousNextButtonEnable ( false ) ;
69
+ }
70
+
70
71
if ( Config . APP_ENV === 'test' ) {
71
72
LogBox . ignoreAllLogs ( true ) ;
72
73
}
0 commit comments