-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
73 lines (66 loc) · 2.35 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
61
62
63
64
65
66
67
68
69
70
71
72
73
import React from 'react'
import { SafeAreaView, View, AsyncStorage } from 'react-native'
import { Drawer } from './config/router'
import { Provider } from 'react-redux'
import { createStackNavigator } from 'react-navigation'
import SearchPage from './Views/SearchPage/SearchPage'
import InfoPage from './Views/InfoPage/InfoPage'
import TenDaysForecastPage from './Views/TenDaysForecastPage/TenDaysForecastPage'
import StartPage from './Views/StartPage/StartPage'
import WarningPage from './Views/WarningPage/WarningPage'
import AnalysisPage from './Views/AnalysisPage/AnalysisPage'
import AllHoursForecastPage from './Views/AllHoursForecastPage/AllHoursForecastPage'
import { persistStore, persistReducer } from 'redux-persist'
import rootReducer from './Redux/index'
import { PersistGate } from 'redux-persist/lib/integration/react'
import { createStore } from 'redux'
import Loading from './Components/Loading'
import CustomDrawerComponent from './config/Components/CustomDrawerContentComponent'
import Sentry from 'sentry-expo';
// Remove this once Sentry is correctly setup.
Sentry.enableInExpoDevelopment = true;
Sentry.config('https://[email protected]/1287229').install();
const persistConfig = {
key: 'root',
storage: AsyncStorage
}
const pReducer = persistReducer(persistConfig, rootReducer)
const store = createStore(pReducer)
const persistor = persistStore(store)
const RootStack = createStackNavigator(
{
Drawer: Drawer,
Sök: { screen: SearchPage },
Info: { screen: InfoPage },
Start: { screen: StartPage },
Långprognos: { screen: TenDaysForecastPage },
Varningar: { screen: WarningPage },
Dataanalys: { screen: AnalysisPage },
Timmar: { screen: AllHoursForecastPage },
CustomDrawerComponent: { screen: CustomDrawerComponent }
},
{
initialRouteName: 'Drawer',
headerMode: 'none'
}
)
export default class App extends React.Component {
render () {
return (
<Provider store={store}>
<PersistGate
loading={
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Loading message='Laddar Väder Norden...' />
</View>
}
persistor={persistor}
>
<SafeAreaView style={{ flex: 1 }}>
<RootStack />
</SafeAreaView>
</PersistGate>
</Provider>
)
}
}