-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
60 lines (53 loc) · 1.42 KB
/
App.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React, { useEffect } from 'react';
import { themeSelected } from './actions';
import { dispatch } from 'redux';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { fromLeft } from 'react-navigation-transitions';
import { Provider } from 'react-redux';
import store from './store';
import AsyncStorage from '@react-native-community/async-storage';
import Introduction from './screens/Introduction';
import Login from './screens/Login';
import Registration from './screens/Registration';
import RegistrationTwo from './screens/RegistrationTwo';
import RecoverPassword from './screens/RecoverPassword';
import Home from './screens/Home';
import Chat from './screens/Chat';
import OpenChat from './screens/OpenChat';
import Settings from './screens/Settings';
const App = createAppContainer(
createStackNavigator(
{
Introduction,
Login,
Registration,
RegistrationTwo,
RecoverPassword,
Home,
Chat,
OpenChat,
Settings,
},
{
//initialRouteName: 'OpenChat',
headerMode: 'none',
//transitionConfig: () => fromLeft(),
}
)
);
const AppWithStore = () => {
useEffect(() => {
const loadTheme = async () =>
dispatch(themeSelected(await AsyncStorage.getItem('@itae_theme')));
try {
loadTheme();
} catch (e) {}
}, []);
return (
<Provider store={store}>
<App />
</Provider>
);
};
export default AppWithStore;