forked from mendoza-git/JonssonConnect
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.js
executable file
·224 lines (203 loc) · 6.99 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/**
* JonssonConnect App Page
* Developed in part by Manu, Akshay, Vignesh, Ramya, & Jahnavi
*/
import React, { Component } from 'react';
import { ActivityIndicator, AsyncStorage, Image, ListView, FlatList, StyleSheet, TouchableOpacity, View } from 'react-native';
import { createMaterialTopTabNavigator, createStackNavigator, createSwitchNavigator, createDrawerNavigator } from "react-navigation";
import { Container, Header, Content, Card, CardItem, Thumbnail, Icon, Text, Title, Button, Left, Body, Right, H1, H2, H3 } from 'native-base';
//import ComputerScience from './tabs/ComputerScience'
//import Profile from './tabs/Profile'
import Home from './tabs/Home';
import Jobs from './tabs/Jobs';
import Events from './tabs/Events';
import Login from './tabs/Login';
import EventDetails from './tabs/EventDetails';
import JobsDetails from './tabs/JobsDetails';
import ArticleDetails from './tabs/ArticleDetails';
import EventsCalendar from './tabs/EventsCalendar';
import DrawerScreen from './tabs/DrawerScreen';
import Rewards from './tabs/Rewards';
import Help from './tabs/Help';
import Agenda from './tabs/Agenda';
import Qrcode from './tabs/Qrcode';
import Redeem from './tabs/Redeem';
import CodeDisplay from './tabs/CodeDisplay';
import * as firebase from 'firebase';
console.disableYellowBox = true
// Initialize Firebase
export var config = {
apiKey: "TODO",
authDomain: "jonssonconnect.firebaseapp.com",
databaseURL: "https://jonssonconnect.firebaseio.com",
projectId: "jonssonconnect",
storageBucket: "jonssonconnect.appspot.com",
};
export const firebaseApp = firebase.initializeApp(config);
export const HomeFeedStack = createStackNavigator({
Home: {
screen: Home,
navigationOptions: ({ navigation }) => ({
title: "News Feed",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
ArticleDetails: {
screen: ArticleDetails,
navigationOptions: ({ navigation }) => ({
title: "News Article",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
Rewards: {
screen: Rewards,
navigationOptions: ({ navigation }) => ({
title: "Rewards",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
Redeem: {
screen: Redeem,
navigationOptions: ({ navigation }) => ({
title: "Redeem Whoosh Bits",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
CodeDisplay: {
screen: CodeDisplay,
navigationOptions: ({ navigation }) => ({
title: "QR Code",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
Help: {
screen: Help,
navigationOptions: ({ navigation }) => ({
title: "Help & Feedback",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
}
});
export const EventsFeedStack = createStackNavigator({
EventsTab: {
screen: EventsCalendar,
navigationOptions: ({ navigation }) => ({
title: "Events Calendar",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
EventDetails: { screen: EventDetails,
navigationOptions: ({ navigation }) => ({
title: "Event Details",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
EventsCalendar: { screen: EventsCalendar },
Agenda: {
screen: Agenda,
navigationOptions: ({ navigation }) => ({
title: "Events List",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
Qrcode: { screen: Qrcode,
navigationOptions: ({ navigation }) => ({
title: "Scan QR Code Here",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
});
export const JobsFeedStack = createStackNavigator({
JobsTab: {
screen: Jobs,
navigationOptions: ({ navigation }) => ({
title: "Job Listings",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
JobsDetails: { screen: JobsDetails,
navigationOptions: ({ navigation }) => ({
title: "Job Details",
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
})
},
});
export const AppScreenNavigator = createMaterialTopTabNavigator({
Home: { screen: HomeFeedStack },
Jobs: { screen: JobsFeedStack },
Events: { screen: EventsFeedStack },
},
{
tabBarPosition: 'bottom',
swipeEnabled: true,
animationEnabled: true,
tabBarOptions: {
activeTintColor: '#FFFFFF',
labelStyle: {
fontSize: 15,
},
style: {
backgroundColor: '#008542', // UTD Color
},
}
});
export const DrawerNavigator = createDrawerNavigator({
AppScreenNavigator: {
screen: AppScreenNavigator
}
}, {
//initialRouteName: 'HomeFeedStack',
contentComponent: DrawerScreen,
drawerWidth: 250
});
const MenuImage = ({ navigation }) => {
if (!navigation.state.isDrawerOpen) {
return <Text>Not Open</Text>
} else {
return <Text>Drawer is Open</Text>
}
}
// Main navigator for the app
const AppNavigator = createSwitchNavigator({
Login: {
screen: Login,
navigationOptions: ({ navigation }) => ({
header: null
})
},
DrawerNavigator: {
screen: DrawerNavigator
}
}, {
navigationOptions: ({ navigation }) => ({
title: 'ReactNavigation', // Title to appear in status bar
headerLeft:
<TouchableOpacity onPress={() => { navigation.dispatch(DrawerActions.toggleDrawer()) }}>
<MenuImage style="styles.bar" navigation={navigation} />
</TouchableOpacity>,
headerStyle: {
backgroundColor: '#333',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
})
});
AppScreenNavigator.navigationOptions = {
title: "App"
};
export default AppNavigator
//export default AppScreenNavigator