-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
executable file
·203 lines (186 loc) · 5.74 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
import React, {Component} from 'react';
import {Button, View, StyleSheet, SafeAreaView, ScrollView, Dimensions, Image} from 'react-native';
import Home from './src/pages/Home';
import AgendaScreen from './src/pages/Agenda';
import Albums from './src/pages/Albums';
import FoodMenu from './src/pages/FoodMenu';
import Messages from './src/pages/Messages';
import Message from './src/pages/Message';
import Events from './src/pages/Events';
import Event from './src/pages/Event';
import Profile from './src/pages/Profile';
import Regulations from './src/pages/Regulations';
import Requests from './src/pages/Requests';
import Login from "./src/pages/login";
import Activities from "./src/pages/Activities";
import ChildProfile from "./src/pages/ChildProfile";
import SideBar from "./src/Components/SideBar/SideBar.js";
import {
createDrawerNavigator, DrawerNavigator, DrawerItems, createSwitchNavigator, createStackNavigator, createAppContainer
} from "react-navigation";
import {HeaderComponent} from "./src/Components/header";
// import firebase from 'react-native-firebase';
//Get Screen Size
const {width} = Dimensions.get('window')
const CustomDrawerComponent = (props) => (
<SafeAreaView style={{flex: 1}}>
<View style={{height: 150, alignItems: 'center'}}>
<Image
source={require('./src/pages/assets/photos/menuIcon.png')}
style={{height: 150, width: 150}}
/>
</View>
<ScrollView>
<DrawerItems {...props} />
</ScrollView>
</SafeAreaView>
)
const AuthStackNavigator = createStackNavigator({
Login: {screen: Login}
})
const HomeScreenRouter = createDrawerNavigator(
{
Feeds: {screen: Home},
Agenda: {screen: AgendaScreen},
Requests: {screen: Requests},
Messages: {screen: Messages},
Message: {
screen: Message,
navigationOptions: {
drawerLabel: () => null,
}
},
Albums: {screen: Albums},
Activities: {screen: Activities},
'Food Menu': {screen: FoodMenu},
Events: {screen: Events},
'Event': {
screen: 'Event',
navigationOptions: {
drawerLabel: () => null,
}
},
Profile: {screen: Profile},
ChildProfile: {
screen: ChildProfile,
navigationOptions: {
drawerLabel: () => null,
}
},
Regulations: {screen: Regulations},
},
{
//contentComponent: props => <SideBar {...props} />
contentComponent: CustomDrawerComponent,
contentOptions: {
activeTintColor: '#e31837',
itemStyle: {
borderBottomWidth: 0.55,
borderColor: '#e31837',
}
}
//drawerWidth: width //Put Drawer to full screen
});
const ProfileStackNavigator = createStackNavigator({
Profile: {screen: Profile},
ChildProfile: {screen: (props) => <ChildProfile {...props} />}
},
{
headerMode: 'none',
navigationOptions: {
headerVisible: false,
}
});
const MessagesStackNavigator = createStackNavigator({
Messages: {screen: Messages},
Message: {screen: (props) => <Message {...props} />}
},
{
headerMode: 'none',
navigationOptions: {
headerVisible: false,
}
});
const EventsStackNavigator = createStackNavigator({
Events: {screen: Events},
'Event': {screen: (props) => <Event {...props} />}
},
{
headerMode: 'none',
navigationOptions: {
headerVisible: false,
}
});
const AppNavigator = createSwitchNavigator({
Auth: AuthStackNavigator,
App: HomeScreenRouter,
Profile: ProfileStackNavigator,
Message: MessagesStackNavigator,
'Event': EventsStackNavigator,
});
const App = createAppContainer(AppNavigator);
export default App;
// export default class App extends Component {
// componentDidMount() {
// SplashScreen.hide();
// }
// componentWillMount() {
// OneSignal.init("76f5d387-65a6-4a11-bad9-18c7f4ae06f7");
// }
// componentWillMount() {
// OneSignal.init("76f5d387-65a6-4a11-bad9-18c7f4ae06f7", {kOSSettingsKeyAutoPrompt : true});
// OneSignal.addEventListener('received', this.onReceived);
// OneSignal.addEventListener('opened', this.onOpened);
// OneSignal.addEventListener('ids', this.onIds);
// }
// componentWillUnmount() {
// OneSignal.removeEventListener('received', this.onReceived);
// OneSignal.removeEventListener('opened', this.onOpened);
// OneSignal.removeEventListener('ids', this.onIds);
// }
//
// onReceived(notification) {
// console.log("Notification received: ", notification);
// }
//
// onOpened(openResult) {
// console.log('Message: ', openResult.notification.payload.body);
// console.log('Data: ', openResult.notification.payload.additionalData);
// console.log('isActive: ', openResult.notification.isAppInFocus);
// console.log('openResult: ', openResult);
// }
//
// onIds(device) {
// console.log('Device info: ', device);
// }
//
// render() {
// return (
// <AppNavigator { ...this.props }/>
// );
// }
// }
// import SideBar from "./src/pages/sidebar";
// export default createDrawerNavigator({
// Login: Login,
// Home: Home,
// Agenda: Agenda,
// Albums: Albums,
// Attendance: Attendance,
// Events: Events,
// Feeds: Feeds,
// FoodMenu: FoodMenu,
// Messages: Messages,
// Profile: Profile,
// Regulations: Regulations,
// Requests: Requests,
// });
//
// const CustomDrawerComponent = (props) => {
// <SafeAreaView style={{flex: 1}}>
// <ScrollView>
// <DrawerItems {...props}/>
// </ScrollView>
// </SafeAreaView>
// }
//