-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
109 lines (98 loc) · 2.87 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
107
108
109
import React from 'react';
import {createStackNavigator, createBottomTabNavigator} from 'react-navigation';
import SignUp from './Screens/Auth/SignUp';
import config from './firebase-config';
import * as firebase from 'firebase';
import LoadApp from './Screens/LoadApp';
import Login from "./Screens/Auth/Login";
import ClientProfile from "./Screens/Profile/ClientProfile";
import LawyerProfile from "./Screens/Profile/LawyerProfile";
import SetupLawyerProfile from "./Screens/Profile/SetupLawyerProfile";
import AdminProfile from "./Screens/Profile/AdminProfile";
import Fire from './Fire';
import CaseSearch from "./Screens/Cases/CaseSearch";
import LawyerAuth from "./Screens/Admin/LawyerAuth";
import {YellowBox} from 'react-native';
//import CaseList from "./Screens/Cases/CaseList";
import ClientCases from "./Screens/Cases/ClientCases";
import EditClientProfile from "./Screens/Profile/EditClientProfile";
import Video from "expo/build/av/Video";
import {Text} from "react-native-elements";
// API information in firebase-config.js
// firebase.initializeApp(config);
let fire = new Fire();
fire.init();
console.disableYellowBox = true;
/* Todo: Remove "Require cycle" warning from console. Require cycle is not an issue in our code, but in
* the expo build itself. Fixed in later versions of the sdk, but not worth upgrading at the moment
* https://github.com/expo/expo/issues/2538\
* For some reason YellowBox.ignoreWarnings() doesn't work...
*/
const LawyerTabNav = createBottomTabNavigator({
ViewProfile: {
screen: LawyerProfile
},
CaseSearch: {
screen: CaseSearch
}
}, {
tabBarPosition: 'bottom'
});
const MainStack = createStackNavigator({
// CaseList: {
// screen: CaseList
// },
// LoadApp: {
// screen: LoadApp
// },
Login: {
screen: Login
},
SignUp: {
screen: SignUp
},
AdminProfile: {
screen: AdminProfile
},
LawyerAuth: {
screen: LawyerAuth
},
SetupLawyerProfile: {
screen: SetupLawyerProfile
},
EditClientProfile: {
screen: EditClientProfile
},
LawyerTabNav: {
screen: LawyerTabNav
},
ClientCases: {
screen: ClientCases
},
ClientProfile: {
screen: ClientProfile
},
CaseSearch: {
screen: CaseSearch
}
}, {
// After login
// Main: { screen: Main },
navigationOptions: {header: null}
});
class App extends React.Component {
state = {
render : false
};
// SignUp component is a placeholder before we use react-navigation
render() {
if(this.state.render){
return(<MainStack/>);
} else{
firebase.auth().signInWithEmailAndPassword("[email protected]", "1234567")
.then(() => {this.setState({render:true})});
return(<Text>Waiting</Text>);
}
}
}
export default App;