summaryrefslogtreecommitdiff
path: root/App.js
diff options
context:
space:
mode:
Diffstat (limited to 'App.js')
-rw-r--r--App.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/App.js b/App.js
index c73914b..77d5f78 100644
--- a/App.js
+++ b/App.js
@@ -1,8 +1,18 @@
import React from 'react';
import { Provider } from 'react-redux';
+import { PersistGate } from 'redux-persist/integration/react';
+import createStore from './src/Store/store';
import Main from './src/Main';
-import store from './src/Store/store'
+import { ActivityIndicator, Text, View } from 'react-native';
-const App = () => (<Provider store={store}><Main /></Provider>)
+const { store, persistor } = createStore();
-export default App \ No newline at end of file
+const loading = (<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}><ActivityIndicator /><Text>Загрузка состояния...</Text></View>);
+
+const App = () => (<Provider store={store}>
+ <PersistGate loading={loading} persistor={persistor}>
+ <Main />
+ </PersistGate>
+</Provider>);
+
+export default App; \ No newline at end of file