/
App.js
161 lines (142 loc) · 5.18 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
'use strict';
// Horrible polyfill hack for outdated code that uses now-defunct View.propTypes
import { View, ViewPropTypes } from 'react-native';
if(!View.propTypes) {
View.__proto__.propTypes = ViewPropTypes;
}
//Import React
import React, {Component} from 'react';
const styles = require("./styles");
// Import firebase
const firebaseApp = require('./src/services/firebaseInit');
//Import Icon
import Icon from 'react-native-vector-icons/MaterialIcons'
// Import pages
const SignupScreen = require('./src/pages/Signup'); //this screen is the sign up page
const LoginScreen = require('./src/pages/Login'); //this screen is the log in page
const MeScreen = require('./src/pages/Me'); //this screen is the me screen.
const ProfileScreen = require('./src/pages/Profile'); //this is the user's profile (you can view your info here)
const EditProfileScreen = require('./src/pages/EditProfile'); //this is the user's profile (you can edit your info here)
const FriendslistScreen = require('./src/pages/Friendslist'); //this is the list of friends
const UserDetailScreen = require('./src/pages/UserDetail'); //this screen shows you another user's profile
const AddFriendScreen = require('./src/pages/AddFriend'); //this is the page where you can search for friends and add them
const MatchesScreen = require('./src/pages/Matches'); //this is your matches page
const PendingMatchesScreen = require('./src/pages/PendingMatches')
// Import screen navigation
import {
StackNavigator, TabNavigator
} from 'react-navigation';
import { BottomNavigation, NavigationComponent, Tab } from 'react-native-material-bottom-navigation'
export const InitStack = StackNavigator({
Login: {screen: LoginScreen},
Signup: {screen: SignupScreen},
});
export const FriendStack = StackNavigator({
Friendslist: {screen: FriendslistScreen},
UserDetail: {screen: UserDetailScreen},
AddFriend: {screen: AddFriendScreen},
}, {
lasyLoad: false
});
export const MainMatchesNavigator = TabNavigator({
Pending: {screen: PendingMatchesScreen},
Matches: {screen: MatchesScreen},
}, {
tabBarComponent: NavigationComponent,
tabBarPosition: 'top',
// swipeEnabled: false,
// lazy: true,
// animationEnabled: false,
tabBarOptions: {
style: {
borderTopColor: "black",
borderWidth: 0,
borderTopWidth: 2,
},
activeTintColor: "white",
inactiveTintColor: "gray",
bottomNavigationOptions: {
labelColor: styles.constants.tabButtons,
rippleColor: styles.constants.tabRipple,
tabs: {
Pending: {
label: 'Pending Requests',
barBackgroundColor: styles.constants.tabMatchBG,
showIcon: true,
icon: (<Icon size={24} color={styles.constants.tabButtons} name="people"/>)
},
Matches: {
label: 'Matched!',
barBackgroundColor: styles.constants.tabMatchBG,
showIcon: true,
icon: (<Icon size={24} color={styles.constants.tabButtons} name="people"/>)
},
}
}
}
});
export const MatchesStack = StackNavigator({
Matches: {screen: MainMatchesNavigator},
UserDetail: {screen: UserDetailScreen},
});
export const MeStack = StackNavigator({
Me: {screen: MeScreen},
Profile: {screen: ProfileScreen},
EditProfile: {screen: EditProfileScreen}
}, {gesturesEnabled:false});
export const Tabs = TabNavigator({
Me: { screen: MeStack },
Friends: { screen: FriendStack },
Matches: { screen: MatchesStack }
}, {
tabBarComponent: NavigationComponent,
tabBarPosition: 'bottom',
swipeEnabled: false,
lazy: true,
animationEnabled: false,
tabBarOptions: {
labelColor: styles.constants.tabButtons,
rippleColor: styles.constants.tabRipple,
bottomNavigationOptions: {
tabs: {
Me: {
labelColor: styles.constants.tabButtons,
label: 'Me',
barBackgroundColor: styles.constants.tabBG,
showIcon: true,
icon: (<Icon size={24} color={styles.constants.tabButtons} name="person" />)
},
Friends: {
labelColor: styles.constants.tabButtons,
label: 'Friends',
barBackgroundColor: styles.constants.tabBG,
showIcon: true,
icon: (<Icon size={24} color={styles.constants.tabButtons} name="people"/>),
},
Matches: {
labelColor: styles.constants.tabButtons,
label: 'Matches',
barBackgroundColor: styles.constants.tabBG,
showIcon: true,
icon: (<Icon size={24} color={styles.constants.tabButtons} name="chat-bubble" />)
}
}
}
}
})
export const Root = StackNavigator({
InitStack: {
screen: InitStack,
},
Tabs: {
screen: Tabs,
navigationOptions: {
gesturesEnabled:false,
}
},
}, {
mode: 'modal',
headerMode: 'none',
});
module.exports = Root;
module.exports.firebaseApp = firebaseApp;