Skip to content

Commit 7a4801c

Browse files
committed
Updated with final code from Phase 2
1 parent 0e83292 commit 7a4801c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+15783
-7617
lines changed

App.js

100644100755
Lines changed: 214 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,224 @@
11
/**
2-
* JonssonConnect Application
3-
* https://github.com/facebook/react-native
4-
* @flow
2+
* JonssonConnect App Page
3+
* Developed in part by Manu, Akshay, Vignesh, Ramya, & Jahnavi
54
*/
6-
import React, { Component } from 'react';
7-
import { ActivityIndicator, AsyncStorage, Image, ListView, FlatList, StyleSheet, TouchableHighlight, View } from 'react-native';
8-
import { TabNavigator, StackNavigator } from "react-navigation";
9-
import { Container, Header, Content, Card, CardItem, Thumbnail, Icon, Text, Title, Button, Left, Body, Right, H1, H2, H3 } from 'native-base';
10-
//import ComputerScience from './tabs/ComputerScience'
11-
//import Profile from './tabs/Profile'
12-
import Home from './tabs/Home';
13-
import Jobs from './tabs/Jobs';
14-
import Events from './tabs/Events';
15-
import Login from './tabs/Login';
16-
import EventDetails from './tabs/EventDetails';
17-
import JobsDetails from './tabs/JobsDetails';
18-
import ArticleDetails from './tabs/ArticleDetails';
19-
import * as firebase from 'firebase';
20-
21-
// Initialize Firebase
22-
export var config = {
23-
apiKey: "TODO",
24-
authDomain: "jonssonconnect.firebaseapp.com",
25-
databaseURL: "https://jonssonconnect.firebaseio.com",
26-
projectId: "jonssonconnect",
27-
storageBucket: "jonssonconnect.appspot.com",
28-
};
29-
30-
export const firebaseApp = firebase.initializeApp(config);
31-
32-
export const HomeFeedStack = StackNavigator({
33-
Home: {
34-
screen: Home,
35-
navigationOptions:({navigation}) => ({
5+
6+
import React, { Component } from 'react';
7+
import { ActivityIndicator, AsyncStorage, Image, ListView, FlatList, StyleSheet, TouchableOpacity, View } from 'react-native';
8+
import { createMaterialTopTabNavigator, createStackNavigator, createSwitchNavigator, createDrawerNavigator } from "react-navigation";
9+
import { Container, Header, Content, Card, CardItem, Thumbnail, Icon, Text, Title, Button, Left, Body, Right, H1, H2, H3 } from 'native-base';
10+
11+
//import ComputerScience from './tabs/ComputerScience'
12+
//import Profile from './tabs/Profile'
13+
import Home from './tabs/Home';
14+
import Jobs from './tabs/Jobs';
15+
import Events from './tabs/Events';
16+
import Login from './tabs/Login';
17+
import EventDetails from './tabs/EventDetails';
18+
import JobsDetails from './tabs/JobsDetails';
19+
import ArticleDetails from './tabs/ArticleDetails';
20+
import EventsCalendar from './tabs/EventsCalendar';
21+
import DrawerScreen from './tabs/DrawerScreen';
22+
import Rewards from './tabs/Rewards';
23+
import Help from './tabs/Help';
24+
import Agenda from './tabs/Agenda';
25+
import Qrcode from './tabs/Qrcode';
26+
import Redeem from './tabs/Redeem';
27+
import CodeDisplay from './tabs/CodeDisplay';
28+
29+
import * as firebase from 'firebase';
30+
31+
console.disableYellowBox = true
32+
33+
// Initialize Firebase
34+
export var config = {
35+
apiKey: "TODO",
36+
authDomain: "jonssonconnect.firebaseapp.com",
37+
databaseURL: "https://jonssonconnect.firebaseio.com",
38+
projectId: "jonssonconnect",
39+
storageBucket: "jonssonconnect.appspot.com",
40+
};
41+
42+
export const firebaseApp = firebase.initializeApp(config);
43+
44+
export const HomeFeedStack = createStackNavigator({
45+
Home: {
46+
screen: Home,
47+
navigationOptions: ({ navigation }) => ({
3648
title: "News Feed",
37-
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#ffffff', borderBottomWidth: 1},
38-
headerTitleStyle: { fontSize: 18, fontWeight: '100'},
49+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
50+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
51+
})
52+
},
53+
54+
ArticleDetails: {
55+
screen: ArticleDetails,
56+
navigationOptions: ({ navigation }) => ({
57+
title: "News Article",
58+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
59+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
60+
})
61+
},
62+
63+
Rewards: {
64+
screen: Rewards,
65+
navigationOptions: ({ navigation }) => ({
66+
title: "Rewards",
67+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
68+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
3969
})
40-
},
41-
ArticleDetails: {screen: ArticleDetails},
42-
});
43-
44-
export const EventsFeedStack = StackNavigator({
45-
EventsTab: {
46-
screen: Events,
47-
navigationOptions:({navigation}) => ({
48-
title: "Event Listings",
49-
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#ffffff', borderBottomWidth: 1},
50-
headerTitleStyle: { fontSize: 18, fontWeight: '100' },
70+
},
71+
72+
Redeem: {
73+
screen: Redeem,
74+
navigationOptions: ({ navigation }) => ({
75+
title: "Redeem Whoosh Bits",
76+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
77+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
5178
})
52-
},
53-
EventDetails: {screen: EventDetails},
54-
});
55-
56-
export const JobsFeedStack = StackNavigator({
57-
JobsTab: {
58-
screen: Jobs,
59-
navigationOptions:({navigation}) => ({
79+
},
80+
81+
CodeDisplay: {
82+
screen: CodeDisplay,
83+
navigationOptions: ({ navigation }) => ({
84+
title: "QR Code",
85+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12' },
86+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
87+
})
88+
},
89+
90+
Help: {
91+
screen: Help,
92+
navigationOptions: ({ navigation }) => ({
93+
title: "Help & Feedback",
94+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
95+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
96+
})
97+
}
98+
});
99+
100+
export const EventsFeedStack = createStackNavigator({
101+
EventsTab: {
102+
screen: EventsCalendar,
103+
navigationOptions: ({ navigation }) => ({
104+
title: "Events Calendar",
105+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
106+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
107+
})
108+
},
109+
EventDetails: { screen: EventDetails,
110+
navigationOptions: ({ navigation }) => ({
111+
title: "Event Details",
112+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
113+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
114+
})
115+
},
116+
EventsCalendar: { screen: EventsCalendar },
117+
Agenda: {
118+
screen: Agenda,
119+
navigationOptions: ({ navigation }) => ({
120+
title: "Events List",
121+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
122+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
123+
})
124+
},
125+
Qrcode: { screen: Qrcode,
126+
navigationOptions: ({ navigation }) => ({
127+
title: "Scan QR Code Here",
128+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
129+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
130+
})
131+
},
132+
});
133+
134+
export const JobsFeedStack = createStackNavigator({
135+
JobsTab: {
136+
screen: Jobs,
137+
navigationOptions: ({ navigation }) => ({
60138
title: "Job Listings",
61-
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#ffffff', borderBottomWidth: 1},
62-
headerTitleStyle: { fontSize: 18, fontWeight: '100' },
139+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
140+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
141+
})
142+
},
143+
JobsDetails: { screen: JobsDetails,
144+
navigationOptions: ({ navigation }) => ({
145+
title: "Job Details",
146+
headerStyle: { paddingRight: 10, paddingLeft: 10, backgroundColor: '#C75B12', borderBottomWidth: 1 },
147+
headerTitleStyle: { fontSize: 18, fontWeight: '100', color: 'white' },
63148
})
64-
},
65-
JobsDetails: {screen: JobsDetails},
66-
});
67-
68-
export const AppScreenNavigator = TabNavigator({
69-
HomeFeedStack: {screen: HomeFeedStack},
70-
JobsTab: {screen: JobsFeedStack},
71-
EventsTab: {screen: EventsFeedStack},
72149
},
150+
});
151+
152+
export const AppScreenNavigator = createMaterialTopTabNavigator({
153+
Home: { screen: HomeFeedStack },
154+
Jobs: { screen: JobsFeedStack },
155+
Events: { screen: EventsFeedStack },
156+
},
73157
{
74-
tabBarPosition: 'bottom',
75-
swipeEnabled: false,
76-
animationEnabled: false,
77-
tabBarOptions: {
78-
activeTintColor: '#3e9876',
79-
activeBackgroundColor: '#ffffff',
80-
inactiveBackgroundColor: '#ffffff',
81-
inactiveTintColor: '#B7C3D0',
82-
}
83-
});
84-
85-
const AppNavigator = StackNavigator({
86-
Login:{screen: Login,
87-
navigationOptions:({navigation}) => ({
158+
tabBarPosition: 'bottom',
159+
swipeEnabled: true,
160+
animationEnabled: true,
161+
tabBarOptions: {
162+
activeTintColor: '#FFFFFF',
163+
labelStyle: {
164+
fontSize: 15,
165+
},
166+
style: {
167+
backgroundColor: '#008542', // UTD Color
168+
},
169+
}
170+
});
171+
172+
export const DrawerNavigator = createDrawerNavigator({
173+
AppScreenNavigator: {
174+
screen: AppScreenNavigator
175+
}
176+
}, {
177+
//initialRouteName: 'HomeFeedStack',
178+
contentComponent: DrawerScreen,
179+
drawerWidth: 250
180+
});
181+
182+
const MenuImage = ({ navigation }) => {
183+
if (!navigation.state.isDrawerOpen) {
184+
return <Text>Not Open</Text>
185+
} else {
186+
return <Text>Drawer is Open</Text>
187+
}
188+
}
189+
190+
// Main navigator for the app
191+
const AppNavigator = createSwitchNavigator({
192+
Login: {
193+
screen: Login,
194+
navigationOptions: ({ navigation }) => ({
88195
header: null
89-
})},
90-
AppScreenNavigator:{screen: AppScreenNavigator,
91-
navigationOptions:({navigation}) => ({
92-
gesturesEnabled: false,
93-
header: null})
94-
}});
95-
96-
AppScreenNavigator.navigationOptions = {
97-
title: "App"
98-
};
99-
100-
export default AppNavigator
101-
//export default AppScreenNavigator
196+
})
197+
},
198+
DrawerNavigator: {
199+
screen: DrawerNavigator
200+
}
201+
}, {
202+
navigationOptions: ({ navigation }) => ({
203+
title: 'ReactNavigation', // Title to appear in status bar
204+
headerLeft:
205+
<TouchableOpacity onPress={() => { navigation.dispatch(DrawerActions.toggleDrawer()) }}>
206+
<MenuImage style="styles.bar" navigation={navigation} />
207+
</TouchableOpacity>,
208+
headerStyle: {
209+
backgroundColor: '#333',
210+
},
211+
headerTintColor: '#fff',
212+
headerTitleStyle: {
213+
fontWeight: 'bold',
214+
},
215+
216+
})
217+
});
218+
219+
AppScreenNavigator.navigationOptions = {
220+
title: "App"
221+
};
222+
223+
export default AppNavigator
224+
//export default AppScreenNavigator

App.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import App from './App';
3+
4+
import renderer from 'react-test-renderer';
5+
6+
it('renders without crashing', () => {
7+
const rendered = renderer.create(<App />).toJSON();
8+
expect(rendered).toBeTruthy();
9+
});

0 commit comments

Comments
 (0)