-
Notifications
You must be signed in to change notification settings - Fork 3
/
App.js
101 lines (89 loc) · 2.29 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
import React from "react";
import { TouchableOpacity } from "react-native";
// react-navigation
import { createAppContainer, createSwitchNavigator } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import { createDrawerNavigator } from "react-navigation-drawer";
import Icon from "react-native-vector-icons/FontAwesome";
// importing screens
import Feeds from "./src/screens/Feeds";
import Splash from "./src/screens/Splash";
import Register from "./src/screens/Register";
import Profile from "./src/screens/Profile";
import AddFeed from "./src/screens/AddFeed";
import Syllabus from "./src/screens/Syllabus";
import Profile2 from "./src/screens/Profile2";
import Stats from "./src/screens/Stats";
import Home from "./src/screens/Home";
import firebase from "firebase";
var config = {
databaseURL: "https://aarambh-aider.firebaseio.com",
projectId: "aarambh-aider",
};
firebase.initializeApp(config);
if (!firebase.apps.length) {
firebase.initializeApp(config);
}
const DrawerNavigator = createDrawerNavigator({
Feeds: {
screen: Feeds,
navigationOptions: {
headerShown: false,
},
},
Profile: {
screen: Profile,
navigationOptions: {
headerShown: false,
},
},
Syllabus: {
screen: Syllabus,
navigationOptions: {
headerShown: false,
},
},
Stats: {
screen: Stats,
navigationOptions: {
headerShown: false,
},
},
});
const AppNavigator = createStackNavigator({
Home: {
screen: Home,
navigationOptions: {
headerShown: false,
},
},
Register: {
screen: Register,
navigationOptions: {
headerShown: false,
},
},
Profile: { screen: Profile },
Splash: { screen: Splash },
Profile2: { screen: Profile2 },
AddFeed: { screen: AddFeed },
Feeds: {
screen: DrawerNavigator,
navigationOptions: ({ navigation }) => ({
headerLeft: () => (
<TouchableOpacity
style={{ marginLeft: 20 }}
onPress={() => navigation.toggleDrawer()}
>
<Icon name="indent" size={25} />
</TouchableOpacity>
),
}),
},
});
const AppSwitchNavigator = createSwitchNavigator({
Splash: { screen: Splash },
AppNavigator: { screen: AppNavigator },
});
const App = createAppContainer(AppSwitchNavigator);
export default App;