|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { PersistGate } from 'redux-persist/integration/react';
|
|
|
|
import { StyleSheet, View } from 'react-native';
|
|
|
|
import { ActivityIndicator } from 'react-native-paper';
|
|
|
|
import { persistor, store } from './appredux/store';
|
|
|
|
import AppRoutes from './navigation/AppRoutes'
|
|
|
|
import Toast from 'react-native-toast-message';
|
|
|
|
import { toastConfig } from './utils/Toast';
|
|
|
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
|
|
import { colors } from '../src/utils/color'
|
|
|
|
|
|
|
|
const App = () => {
|
|
|
|
return (
|
|
|
|
<Provider store={store}>
|
|
|
|
<PersistGate loading={
|
|
|
|
<View style={styles.container}>
|
|
|
|
<ActivityIndicator size='large' style={{ backgroundColor: colors.pureWhite }} animating={true} color={colors.blue} />
|
|
|
|
</View>
|
|
|
|
} persistor={persistor}>
|
|
|
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
|
|
<AppRoutes />
|
|
|
|
<Toast position='bottom' config={toastConfig} visibilityTime={5000} />
|
|
|
|
</GestureHandlerRootView>
|
|
|
|
</PersistGate>
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
backgroundColor: 'white',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default App;
|