-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
105 lines (92 loc) · 2.83 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
console.disableYellowBox = true;
import React from 'react';
import { Font } from 'expo';
import { createSwitchNavigator, createStackNavigator } from 'react-navigation';
import * as firebase from 'firebase';
import Sentry from 'sentry-expo';
import AuthLoadingScreen from './src/screens/Auth/AuthLoadingScreen';
import LoginScreen from './src/screens/Auth/LoginScreen';
import SignUpScreen from './src/screens/Auth/SignUpScreen';
import SignUpLoginScreen from './src/screens/Auth/SignUpLoginScreen';
import ForgotPasswordScreen from './src/screens/Auth/ForgotPasswordScreen';
import HomeScreen from './src/screens/HomeScreen';
import MeScreen from './src/screens/MeScreen';
import LogNewSessionScreen from './src/screens/LogNewSessionScreen';
import SubmitLogScreen from './src/screens/SubmitLogScreen';
import ViewLogScreen from './src/screens/ViewLogScreen';
// Remove this once Sentry is correctly setup.
// Sentry.enableInExpoDevelopment = true;
Sentry.config('https://a1cda1492c96487c9f552d2fda4aa5ce@sentry.io/1277442').install();
// Sentry.captureException(new Error('Oops!'))
firebase.initializeApp({
apiKey: 'AIzaSyAhvETpCtA9thHsBvq9Nms08jXB8X93kWc',
authDomain: 'cannasseur-3e6f3.firebaseapp.com',
databaseURL: 'https://cannasseur-3e6f3.firebaseio.com',
projectId: 'cannasseur-3e6f3',
storageBucket: 'cannasseur-3e6f3.appspot.com',
messagingSenderId: '59531614040'
});
const AuthStack = createStackNavigator(
{
Login: LoginScreen,
SignUp: SignUpScreen,
SignUpLogin: SignUpLoginScreen,
ForgotPassword: ForgotPasswordScreen
},
{
initialRouteName: 'SignUpLogin',
headerMode: 'none',
navigationOptions: {
headerVisible: false
}
}
);
const AppStack = createStackNavigator(
{
Home: HomeScreen,
Me: MeScreen,
LogNewSession: LogNewSessionScreen,
SubmitLog: SubmitLogScreen,
ViewLog: ViewLogScreen
},
{
initialRouteName: 'Home',
navigationOptions: {
headerStyle: {
backgroundColor: '#F4F3EF'
},
headerTintColor: '#000',
headerTitleStyle: {
fontFamily: 'WorkSans'
}
}
}
);
const SwitchNavigator = createSwitchNavigator(
{
AuthLoading: AuthLoadingScreen,
App: AppStack,
Auth: AuthStack
},
{
initialRouteName: 'AuthLoading'
}
);
class App extends React.Component {
state = {
fontLoaded: false
};
async componentDidMount() {
await Font.loadAsync({
'PlayfairDisplay-Italic': require('./assets/fonts/PlayfairDisplay-Italic.ttf'),
'PlayfairDisplay-Regular': require('./assets/fonts/PlayfairDisplay-Regular.ttf'),
WorkSans: require('./assets/fonts/WorkSans-Regular.ttf'),
'WorkSans-Bold': require('./assets/fonts/WorkSans-Bold.ttf')
});
this.setState({ fontLoaded: true });
}
render() {
return this.state.fontLoaded && <SwitchNavigator />;
}
}
export default App;