-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
41 lines (35 loc) · 999 Bytes
/
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
//import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { createStore} from 'redux';
import { Provider } from 'react-redux';
import HomeScreen from './screens/HomeScreen';
import BottomTab from './Navigation';
const reducer = ( state = { menu: 'closeMenu' }, action ) => {
//return state;
// if(action.type == 'OPENMENU'){
// return {
// menu: 'openMenu'
// };
// } else if(action.type == 'CLOSEMENU'){
// return {
// menu: 'closeMenu'
// };
// }
// using switch instead of IF statement
switch(action.type){
case "OPENMENU":
return { menu: 'openMenu' };
case "CLOSEMENU":
return { menu: 'closeMenu' };
default:
return state;
}
};
const database = createStore(reducer);
const App = () => (
<Provider store={database}>
{/* <HomeScreen /> */}
<BottomTab />
</Provider>
);
export default App;