-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomeStack.js
38 lines (37 loc) · 1.19 KB
/
HomeStack.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
import React, { useContext } from "react";
import { createSharedElementStackNavigator } from "react-navigation-shared-element";
import Strings from "../Values/Strings";
import HomeScreen from "App/Containers/Home/HomeScreen";
import DetailsScreen from "App/Containers/Details/DetailsScreen";
const Stack = createSharedElementStackNavigator();
export const HomeStack = () => {
return (
<Stack.Navigator
headerMode="none"
initialRouteName={Strings.Routes.HOME_SCREEN}
>
<Stack.Screen name={Strings.Routes.HOME_SCREEN} component={HomeScreen} />
<Stack.Screen
name={Strings.Routes.DETAILS}
component={DetailsScreen}
options={() => ({
transitionSpec: {
open: {
animation: "timing",
config: { useNativeDriver: true, duration: 800 },
},
close: {
animation: "timing",
config: { duration: 800, useNativeDriver: true },
},
},
cardStyleInterpolator: ({ current: { progress } }) => {
return {
cardStyle: { opacity: progress },
};
},
})}
/>
</Stack.Navigator>
);
};