-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
86 lines (79 loc) · 2.34 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
74
75
76
77
78
79
80
81
82
83
84
import React from 'react';
import {ThemeProvider} from "react-native-magnus";
import theme from "./src/core/styles/theme";
import {
Montserrat_100Thin,
Montserrat_300Light,
Montserrat_400Regular,
Montserrat_500Medium,
Montserrat_700Bold,
Montserrat_900Black,
useFonts
} from '@expo-google-fonts/montserrat';
import Main from "./src/pages/Main";
import {configure} from "mobx";
import {NavigationContainer} from "@react-navigation/native";
import {createSharedElementStackNavigator} from "react-navigation-shared-element";
import CreditCardDetailsPage from "./src/pages/CreditCardDetailsPage";
import AdjustLimitPage from "./src/pages/AdjustLimitPage";
configure({
enforceActions: "never"
})
const Stack = createSharedElementStackNavigator();
export default function App() {
let [fontsLoaded] = useFonts({
black: Montserrat_900Black,
light: Montserrat_300Light,
thin: Montserrat_100Thin,
medium: Montserrat_500Medium,
bold: Montserrat_700Bold,
regular: Montserrat_400Regular
});
if (!fontsLoaded) {
return <></>;
}
return (
<ThemeProvider theme={theme}>
<NavigationContainer>
<Stack.Navigator
mode={"modal"}
screenOptions={{
headerShown: false,
useNativeDriver: true,
gestureEnabled: false,
cardStyleInterpolator: ({current: {progress}}) => ({
cardStyle: {
opacity: progress,
},
}),
}}
>
<Stack.Screen
name="Main"
component={Main}
// sharedElementsConfig={(route, otherRoute, showing) => {
// if(otherRoute.name === "CreditCardDetails") {
// return [{id: "creditCard"}];
// }
// return []
// }}
/>
<Stack.Screen
name="CreditCardDetails"
component={CreditCardDetailsPage}
sharedElementsConfig={(route, otherRoute, showing) => {
// if(otherRoute.name === "Main") {
// return [{id: "creditCard"}];
// }
return ["creditCard"]
}}
/>
<Stack.Screen
name="AdjustLimit"
component={AdjustLimitPage}
/>
</Stack.Navigator>
</NavigationContainer>
</ThemeProvider>
);
}