@@ -154,6 +154,10 @@ var HelperNet = React.createClass({
154
154
this . setState ( { showSettings : false } ) ;
155
155
} ,
156
156
157
+ dismissModal ( ) {
158
+ this . setState ( { receivedEmergency : false } ) ;
159
+ } ,
160
+
157
161
render ( ) {
158
162
159
163
const settings = (
@@ -217,7 +221,7 @@ var HelperNet = React.createClass({
217
221
const modal = (
218
222
< View style = { styles . emergencyReceivedContainer } >
219
223
< Text style = { styles . emergencyReceivedText } >
220
- There is an emergency nearby and you can help!
224
+ There is an emergency nearby and you can help! { '\n\n' }
221
225
{ this . state . receivedEmergencyText }
222
226
</ Text >
223
227
< View style = { styles . buttonGroup } >
@@ -229,29 +233,19 @@ var HelperNet = React.createClass({
229
233
</ TouchableHighlight >
230
234
< TouchableHighlight
231
235
style = { styles . emergencyReceivedButton }
232
- onPress = { this . directTo }
236
+ onPress = { this . dismissModal }
233
237
underlayColor = '#ff0000' >
234
238
< Text style = { styles . emergencyReceivedButtonText } > Dismiss</ Text >
235
239
</ TouchableHighlight >
236
240
</ View >
237
241
</ View >
238
242
) ;
239
243
240
- const EmergencyView = (
244
+ const EmergencyViewContent = (
241
245
< View style = { styles . backgroundContainer } >
242
- < View style = { styles . toolbar } >
243
- < View style = { styles . spaceView } />
244
- < Text style = { styles . toolbarTitle } > HelperNet</ Text >
245
- < TouchableOpacity style = { styles . touchableSettingsIcon }
246
- onPress = { this . showSettings } >
247
- < Image
248
- style = { styles . settingsIcon }
249
- source = { require ( 'image!ic_settings_white_48dp' ) } />
250
- </ TouchableOpacity >
251
- </ View >
252
- < Image
253
- style = { styles . circles }
254
- source = { require ( 'image!background_circles' ) } />
246
+ < Image
247
+ style = { styles . circles }
248
+ source = { require ( 'image!background_circles' ) } />
255
249
< View style = { styles . buttonWrapper } >
256
250
< TouchableHighlight
257
251
style = { styles . emergencyButton }
@@ -262,10 +256,25 @@ var HelperNet = React.createClass({
262
256
</ View >
263
257
< View style = { styles . aroundCountWrapper } >
264
258
< Text style = { styles . aroundCountText } >
265
- { this . state . aroundCount } person nearby.
259
+ { this . state . aroundCount } people nearby.
266
260
</ Text >
267
261
</ View >
268
- { this . state . receivedEmergency ? modal : null }
262
+ </ View >
263
+ ) ;
264
+
265
+ const EmergencyView = (
266
+ < View style = { styles . backgroundContainer } >
267
+ < View style = { styles . toolbar } >
268
+ < View style = { styles . spaceView } > </ View >
269
+ < Text style = { styles . toolbarTitle } > HelperNet</ Text >
270
+ < TouchableOpacity style = { styles . touchableSettingsIcon }
271
+ onPress = { this . showSettings } >
272
+ < Image
273
+ style = { styles . settingsIcon }
274
+ source = { require ( 'image!ic_settings_white_48dp' ) } />
275
+ </ TouchableOpacity >
276
+ </ View >
277
+ { this . state . receivedEmergency ? modal : EmergencyViewContent }
269
278
</ View >
270
279
) ;
271
280
@@ -325,13 +334,13 @@ var styles = StyleSheet.create({
325
334
padding : 20 ,
326
335
backgroundColor : '#F5FCFF' ,
327
336
} ,
328
- emergencyReceivedContainer : {
329
- marginBottom : 15 ,
330
- borderColor : '#e70000' ,
331
- borderWidth : 3 ,
332
- borderRadius : 8 ,
333
- padding : 10
334
- } ,
337
+ // emergencyReceivedContainer: {
338
+ // marginBottom: 15,
339
+ // borderColor: '#e70000',
340
+ // borderWidth: 3,
341
+ // borderRadius: 8,
342
+ // padding: 10
343
+ // },
335
344
numberContainer : {
336
345
// padding: 10
337
346
} ,
@@ -411,8 +420,9 @@ var styles = StyleSheet.create({
411
420
left : 0 ,
412
421
margin : 15 ,
413
422
padding : 10 ,
414
- height : 120 ,
423
+ height : 170 ,
415
424
position : 'absolute' ,
425
+ marginTop : 150 ,
416
426
borderRadius : 5 ,
417
427
backgroundColor : '#f10000'
418
428
} ,
0 commit comments