* @TP-17904 | Mocking service - added server , geolocation apis and data * @TP-17904 | Mocking service - added server , geolocation apis and data * @TP-17904 | Mocking service - added server , geolocation apis and data * @TP-17904 | Mocking service - added server , geolocation apis and data * @TP-17904 | Mocking service - added server , geolocation apis and data
48 lines
1.7 KiB
TypeScript
48 lines
1.7 KiB
TypeScript
import React from 'react';
|
|
import {Provider} from 'react-redux';
|
|
import store, {persistor} from './src/store/store';
|
|
import {PersistGate} from 'redux-persist/integration/react';
|
|
|
|
import {NavigationContainer} from '@react-navigation/native';
|
|
import {navigationRef} from './src/components/utlis/navigationUtlis';
|
|
import FullScreenLoader from './RN-UI-LIB/src/components/FullScreenLoader';
|
|
import ProtectedRouter from './ProtectedRouter';
|
|
import { toastConfigs, ToastContainer } from './RN-UI-LIB/src/components/toast';
|
|
|
|
import ErrorBoundary from './src/common/ErrorBoundary';
|
|
|
|
import * as Sentry from '@sentry/browser';
|
|
import { SENTRY_DSN } from './src/constants/config';
|
|
import useNativeButtons from './src/hooks/useNativeButton';
|
|
import { StatusBar } from 'react-native';
|
|
import { COLORS } from './RN-UI-LIB/src/styles/colors';
|
|
import codePush from 'react-native-code-push';
|
|
import { ENV } from './src/constants/config';
|
|
import { mockApiServer } from './src/mock-api/server';
|
|
Sentry.init({ dsn: SENTRY_DSN });
|
|
|
|
if (ENV !== 'prod') {
|
|
mockApiServer();
|
|
}
|
|
|
|
const App = () => {
|
|
useNativeButtons();
|
|
return (
|
|
<Provider store={store}>
|
|
<PersistGate
|
|
loading={<FullScreenLoader loading />}
|
|
persistor={persistor}>
|
|
<NavigationContainer ref={navigationRef}>
|
|
<StatusBar backgroundColor={COLORS.BACKGROUND.INDIGO_DARK} />
|
|
<ErrorBoundary>
|
|
<ProtectedRouter />
|
|
</ErrorBoundary>
|
|
</NavigationContainer>
|
|
{<ToastContainer config={toastConfigs} position='bottom' />}
|
|
</PersistGate>
|
|
</Provider>
|
|
);
|
|
};
|
|
|
|
export default codePush(App);
|