forked from BlueWallet/BlueWallet
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMain.tsx
38 lines (32 loc) · 932 Bytes
/
Main.tsx
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
import * as Sentry from '@sentry/react-native';
import React, { useEffect } from 'react';
import { StatusBar, AppState, AppStateStatus } from 'react-native';
import RNBootSplash from 'react-native-bootsplash';
import App from './App';
const Main = () => {
useEffect(() => {
const listener = (state: AppStateStatus) => {
switch (state) {
case 'active':
return RNBootSplash.hide({ fade: true }).catch(error => {
Sentry.captureException(error);
});
case 'inactive':
return RNBootSplash.show().catch(error => {
Sentry.captureException(error);
});
}
};
AppState.addEventListener('change', listener);
return () => {
AppState.removeEventListener('change', listener);
};
}, []);
return (
<>
<StatusBar backgroundColor="rgba(0,0,0,0)" translucent />
<App />
</>
);
};
export default Main;