-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
154 lines (144 loc) · 4.41 KB
/
App.tsx
File metadata and controls
154 lines (144 loc) · 4.41 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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import 'react-native-gesture-handler'
import { NavigationContainer } from '@react-navigation/native';
import { createSharedElementStackNavigator } from 'react-navigation-shared-element';
import React from 'react';
import {
StatusBar,
StyleSheet,
} from 'react-native';
import Login from './src/views/Login';
import TabNav from './src/components/navigations/tabNav';
import Recipe from './src/views/Recipe';
import Introduction from './src/views/Introduction';
import CreateRecipe from './src/views/CreateRecipe';
import { SafeAreaView } from 'react-native-safe-area-context';
import forFade from './src/views/utils/forFade';
import forSlide from './src/views/utils/forSlide'
import topSlide from './src/views/utils/topSlide';
import { CardStyleInterpolators } from '@react-navigation/stack';
import { TransitionSpec } from '@react-navigation/stack/lib/typescript/src/types';
import customStyle from './src/views/utils/customCardStyle';
import { AuthProvider } from './src/mongo/AuthProvider'
import SignUp from './src/views/SignUp';
type RootStackParamList = {
Login: undefined;
SignUp: undefined;
DashBoard: object;
Recipe: object;
CreateRecipe: any;
Introduction: any;
}
// const Stack = createStackNavigator<RootStackParamList>();
const Stack = createSharedElementStackNavigator<RootStackParamList>();
const OptionsConfig = {
headerShown: false,
// animationEnabled: false,
}
const transitionConfig: TransitionSpec = {
animation: 'spring',
config: {
stiffness: 1000,
damping: 100,
mass: 3,
overshootClamping: true,
restDisplacementThreshold: 0.01,
restSpeedThreshold: 0.01,
},
};
const App = () => {
return (
<NavigationContainer>
<AuthProvider>
<StatusBar translucent={true}/>
<SafeAreaView style = {{flex: 1}}>
<Stack.Navigator
initialRouteName="Login"
screenOptions={{
transitionSpec: {
open: transitionConfig,
close: transitionConfig,
},
// cardStyleInterpolator: CardStyleInterpolators.forFadeFromBottomAndroid,
cardStyleInterpolator: customStyle,
}}
>
<Stack.Screen
name="DashBoard"
component={TabNav}
// sharedElements={(route, otherRoute, showing) => {
// return [
// {
// id: 'logo',
// animation: 'fade'
// }
// ];
// }}
options={ { ...OptionsConfig, title: "DashBoard" } }
/>
<Stack.Screen
name="Login"
component={Login}
options={ { ...OptionsConfig, title: "Login" } }
/>
<Stack.Screen
name="Recipe"
component={Recipe}
options={{
...OptionsConfig,
title: "Recipe" ,
// cardStyleInterpolator: topSlide,
// gestureEnabled: true,
// gestureDirection: 'vertical-inverted'
}}
/>
<Stack.Screen
name="CreateRecipe"
component={CreateRecipe}
options={ { ...OptionsConfig, title: "CreateRecipe" } }
/>
<Stack.Screen
name="Introduction"
component={Introduction}
options={ { ...OptionsConfig, title: "Introduction" } }
/>
<Stack.Screen
name="SignUp"
component={SignUp}
options={ { ...OptionsConfig, title: "SignUp" } }
/>
</Stack.Navigator>
</SafeAreaView>
</AuthProvider>
</NavigationContainer>
);
};
const styles = StyleSheet.create({
tabContainer: {
borderRadius: 6,
marginHorizontal: 50,
marginBottom: 6,
alignSelf: 'center'
// shadowColor: "#000",
// shadowOffset: {
// width: 0,
// height: 2,
// },
// shadowOpacity: 0.25,
// shadowRadius: 3.84,
// elevation: 5,
},
tabBarContainer: {
height: 70,
borderRadius:1,
backgroundColor: 'white',
shadowColor: "white",
// shadowOffset: {
// width: 0,
// height: 0,
// },
// shadowOpacity: 0,
// shadowRadius: 0,
// elevation: 0,
}
});
export default App;