-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
89 lines (86 loc) · 2.91 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
85
86
87
88
89
import React from 'react';
import {Dimensions,StatusBar} from 'react-native';
import {createAppContainer,createSwitchNavigator} from 'react-navigation';
import createAnimatedSwitchNavigator from 'react-navigation-animated-switch';
import {createStackNavigator,TransitionPresets} from 'react-navigation-stack';
import IndexScreen from './src/screens/IndexScreen' ;
import {Provider} from './src/context/BlogContext';
import ShowScreen from './src/screens/ShowScreen' ;
import CreateScreen from './src/screens/CreateScreen';
import EditScreen from './src/screens/EditScreen';
import SplashScreen from './src/screens/SplashScreen';
import LoginScreen from './src/screens/LoginScreen';
import SignupScreen from './src/screens/SignupScreen';
import PassResetScreen from './src/screens/PassResetScreen';
const wR = Dimensions.get("window").width/392.72727272727275; //width ratio
const hR = Dimensions.get("window").height/776; //height ratio
//hr and wr are used throughout the app to help with scalability/responsiveness
const AppStack = createStackNavigator(
{
Index : IndexScreen,
Show : ShowScreen,
Create : CreateScreen ,
Edit : EditScreen ,
},
{
initialRouteName : 'Index',
defaultNavigationOptions :{
...TransitionPresets.SlideFromRightIOS,
cardStyle: {
backgroundColor: 'transparent', // to remove a white flickering while screen transitions
},
headerTintColor : "#B2983B",
title : "NOTES",
headerStyle : {backgroundColor :"#000000"},
headerTitleStyle : {color : "#B2983B",fontSize : 26*wR,fontFamily :"Roboto",marginLeft: 135*wR}
}
}
);
const AuthStack = createStackNavigator(
{
Login : LoginScreen,
Signup : SignupScreen,
PassReset : PassResetScreen
},
{
initialRouteName : 'Login',
defaultNavigationOptions :{
...TransitionPresets.SlideFromRightIOS,
cardStyle: {
backgroundColor: 'transparent', // to remove a white flickering while screen transitions
},
}
}
);
const SplashStack = createStackNavigator(
{
Splash : SplashScreen
},
{
initialRouteName : 'Splash',
defaultNavigationOptions :{
...TransitionPresets.SlideFromRightIOS,
cardStyle: {
backgroundColor: 'transparent', // to remove a white flickering while screen transitions
},
}
}
);
//switched to createAnimatedSwitchNavigator as the user could back button in index screen to go back to splash screen when plain createStackNavigator was used
const App = createAppContainer(createAnimatedSwitchNavigator(
{
Splash : SplashStack,
Auth : AuthStack,
App: AppStack,
},
{
initialRouteName: 'Splash',
defaultNavigationOptions :{
...TransitionPresets.FadeFromBottomAndroid,
cardStyle: {
backgroundColor: 'transparent', // to remove a white flickering while screen transitions
},}
}
)) ;
export default ()=>{return (<Provider><App/><StatusBar hidden={false} /></Provider>);
}