-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
106 lines (99 loc) · 2.75 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
106
import { Asset } from 'expo-asset';
import * as Font from 'expo-font';
import * as firebase from 'firebase';
import React from 'react';
import { Text, TextInput } from 'react-native';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import bills from './components/bills';
import chat from './components/Chat';
import loading from './components/Loading';
import login from './components/Login';
import main from './components/Main';
import research from './components/Research';
import signup from './components/Signup';
import votehistory from './components/votehistory';
import voting from './components/voting';
console.disableYellowBox = true
var firebaseConfig = {
apiKey: "AIzaSyA6jm4u7jyD9ofrKr4D6HzElN27FKkHiUA",
authDomain: "drivetime-ce314.firebaseapp.com",
databaseURL: "https://drivetime-ce314.firebaseio.com",
projectId: "drivetime-ce314",
storageBucket: "drivetime-ce314.appspot.com",
messagingSenderId: "124667229118",
appId: "1:124667229118:web:97be36df1399fa418fffef",
measurementId: "G-ZGWS3MZ6WJ"
};
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}
export default class AppContainer extends React.Component {
state = {
assetsLoaded: false,
};
constructor() {
//chat.observeAuth();
//SplashScreen.preventAutoHide();
super();
Text.defaultProps = Text.defaultProps || {};
// Ignore dynamic type scaling on iOS
Text.defaultProps.allowFontScaling = false;
TextInput.defaultProps = TextInput.defaultProps || {};
TextInput.defaultProps.allowFontScaling = false;
}
async componentDidMount() {
await Asset.loadAsync([
require('./assets/background.jpg'),
require('./assets/splash.png'),
]);
await Font.loadAsync({
'PoppinsL': require('./assets/fonts/Poppins-Light.ttf'),
'PoppinsM': require('./assets/fonts/Poppins-Medium.ttf'),
});
this.setState({ assetsLoaded: true })
}
render() {
if (!this.state.assetsLoaded) {
return null; // wait until fonts and images are loaded
}
const AppNavigator = createStackNavigator({
Login: {
screen: login
},
Signup: {
screen: signup
},
Main: {
screen: main
},
Research: {
screen: research
},
Loading: {
screen: loading
},
Chat: {
screen: chat
},
Bills: {
screen: bills
},
Voting: {
screen: voting
},
Forum: {
screen: chat
},
Votehistory: {
screen: votehistory
}
},
{
initialRouteName: 'Loading',
headerMode: 'none'
});
const AppContainer = createAppContainer(AppNavigator);
return (<AppContainer />);
}
}