-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
42 lines (39 loc) · 1.09 KB
/
Copy pathApp.js
File metadata and controls
42 lines (39 loc) · 1.09 KB
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
import React, {useState} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
import {Provider, useDispatch, useSelector} from 'react-redux';
import store from './store';
import MapScreen from './screens/MapScreen';
import InfoMartinkirkko from './screens/martinkirkko/InfoMartinkirkko';
import {setCard} from './reducers/cardReducer';
import InfoSuomenjoutsen from './screens/suomenjoutsen/InfoSuomenjoutsen';
import InfoFori from './screens/fori/InfoFori';
const AppWrapper = () => {
return (
<Provider store={store}>
<App />
</Provider>
);
};
const App = () => {
const activity = useSelector(state => state.activeScreen);
const card = useSelector(state => state.card);
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
{!activity && <MapScreen />}
{activity && card === 0 && <InfoMartinkirkko />}
{activity && card === 1 && <InfoSuomenjoutsen />}
{activity && card === 2 && <InfoFori />}
</SafeAreaView>
</>
);
};
export default AppWrapper;