-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.tsx
More file actions
59 lines (53 loc) · 1.51 KB
/
App.tsx
File metadata and controls
59 lines (53 loc) · 1.51 KB
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
import React, {Suspense} from 'react';
import {
View,
SafeAreaView,
Platform,
StatusBar,
useColorScheme,
} from 'react-native';
import {Provider, Button} from '@ant-design/react-native';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import Config from 'react-native-config';
import RouterConfig from './src/routes';
import * as Sentry from '@sentry/react-native';
Sentry.init({
dsn: Config.SENTRY_DSN_ENV,
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
release: Config.SENTRY_RELEASE,
dist: Config.SENTRY_DIST,
});
const App = () => {
const isDarkMode = useColorScheme() === 'dark';
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};
return (
<Provider>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
{Platform.OS === 'android' ? (
<View>
<Suspense fallback={<Button loading>loading button</Button>}>
<RouterConfig />
</Suspense>
</View>
) : (
<SafeAreaView>
<Suspense fallback={<Button loading>loading button</Button>}>
<RouterConfig />
</Suspense>
</SafeAreaView>
)}
</Provider>
);
};
// setTimeout(() => {
// Sentry.captureException(new Error('app tsx'));
// }, 3000);
export default Sentry.wrap(App);