-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
66 lines (57 loc) · 1.69 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
import React from 'react';
import { Easing } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { CourseListing, Dashboard, MainLayout } from './screens';
import { applyMiddleware, createStore } from 'redux'
import ThemeReducer from './Store/ThemeReducer';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
import { createStackNavigator } from '@react-navigation/stack';
import { createSharedElementStackNavigator } from 'react-navigation-shared-element';
const App = () => {
const store = createStore(
ThemeReducer,
applyMiddleware(thunk)
)
const Stack = createSharedElementStackNavigator();
const options = {
gestureEnabled: false,
transitionSpec: {
open: {
animation: 'timing',
config: { duration: 400, easing: Easing.inOut(Easing.ease) }
},
close: {
animation: 'timing',
config: { duration: 400, easing: Easing.inOut(Easing.ease) }
}
},
cardStyleInterpolator: ({ current: { progress } }) => {
return {
cardStyle: {
opacity: progress
}
}
}
}
return (
<Provider store={store} >
<NavigationContainer>
<Stack.Navigator
initialRouteName='Dashboard'
screenOptions={{
useNativeDriver: true,
headerShown: false,
}}
detachInactiveScreens={false}
>
<Stack.Screen name='Dashboard' component={MainLayout} />
<Stack.Screen name='CourseListing'
options={() => options}
component={CourseListing} />
</Stack.Navigator>
</NavigationContainer>
</Provider>
);
};
export default App;