67 lines
2.0 KiB
JavaScript
67 lines
2.0 KiB
JavaScript
import 'react-native-gesture-handler';
|
|
import { enableFreeze } from 'react-native-screens';
|
|
|
|
enableFreeze(true);
|
|
|
|
import React, { useEffect } from 'react';
|
|
import { StatusBar } from 'react-native';
|
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
import LottieSplashScreen from 'react-native-lottie-splash-screen';
|
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
import { Provider as PaperProvider } from 'react-native-paper';
|
|
import { Provider } from 'react-redux';
|
|
import { PersistGate } from 'redux-persist/lib/integration/react';
|
|
import * as Notifications from 'expo-notifications';
|
|
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
|
|
import { createDatabase } from '@database/db';
|
|
import { persistor, store } from '@redux/store';
|
|
import AppErrorBoundary from '@components/AppErrorBoundary/AppErrorBoundary';
|
|
import NewUpdateDialog from '@components/NewUpdateDialog';
|
|
|
|
import Main from './src/navigators/Main';
|
|
|
|
// Initialize trackers
|
|
import './src/services/Trackers/index';
|
|
import './src/services/Trackers/aniList';
|
|
import './src/services/Trackers/myAnimeList';
|
|
|
|
Notifications.setNotificationHandler({
|
|
handleNotification: async () => {
|
|
return {
|
|
shouldShowAlert: true,
|
|
shouldPlaySound: true,
|
|
shouldSetBadge: true,
|
|
};
|
|
},
|
|
});
|
|
|
|
const App = () => {
|
|
useEffect(() => {
|
|
LottieSplashScreen.hide();
|
|
createDatabase();
|
|
}, []);
|
|
|
|
return (
|
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
<AppErrorBoundary>
|
|
<Provider store={store}>
|
|
<PersistGate loading={null} persistor={persistor}>
|
|
<SafeAreaProvider>
|
|
<PaperProvider>
|
|
<BottomSheetModalProvider>
|
|
<NewUpdateDialog />
|
|
<StatusBar translucent={true} backgroundColor="transparent" />
|
|
<Main />
|
|
</BottomSheetModalProvider>
|
|
</PaperProvider>
|
|
</SafeAreaProvider>
|
|
</PersistGate>
|
|
</Provider>
|
|
</AppErrorBoundary>
|
|
</GestureHandlerRootView>
|
|
);
|
|
};
|
|
|
|
export default App;
|