@@ -219,151 +219,146 @@ export default function EventPage() {
219
219
220
220
return (
221
221
< Container >
222
- < KeyboardAvoidingView
223
- behavior = { Platform . OS === "ios" ? "padding" : "height" }
224
- enabled = { isEditable }
225
- >
226
- < ScrollView >
227
- { loading ? (
228
- < LoadingPage />
229
- ) : (
230
- < View >
231
- { events ?. deleted ? (
232
- < EmptyPage
233
- title = { `The event ${ events ?. name } has been removed` }
234
- subtitle = "To know more about it, contact the organizers"
235
- image = { require ( "../../../assets/deleted.webp" ) }
236
- />
237
- ) : (
222
+ < ScrollView >
223
+ { loading ? (
224
+ < LoadingPage />
225
+ ) : (
226
+ < View >
227
+ { events ?. deleted ? (
228
+ < EmptyPage
229
+ title = { `The event ${ events ?. name } has been removed` }
230
+ subtitle = "To know more about it, contact the organizers"
231
+ image = { require ( "../../../assets/deleted.webp" ) }
232
+ />
233
+ ) : (
234
+ < View >
235
+ < ImageHeader source = { { uri : events ?. headerImage } } />
238
236
< View >
239
- < ImageHeader source = { { uri : events ?. headerImage } } />
240
- < View >
241
- { isEditable ? (
242
- < View style = { { padding : 30 } } >
243
- < ButtonsRowContainerLeft >
244
- < Button
245
- title = "Close"
246
- onPress = { ( ) => {
247
- setIsEditable ( false ) ;
248
- } }
249
- color = { systemColors . destroy }
250
- iconName = "close"
251
- />
252
- </ ButtonsRowContainerLeft >
253
- < EventForm
254
- inputs = { inputs }
255
- setInputs = { setInputs }
256
- createTheEvent = { updateTheEvent }
257
- isUpdate
237
+ { isEditable ? (
238
+ < View style = { { padding : 30 } } >
239
+ < ButtonsRowContainerLeft >
240
+ < Button
241
+ title = "Close"
242
+ onPress = { ( ) => {
243
+ setIsEditable ( false ) ;
244
+ } }
245
+ color = { systemColors . destroy }
246
+ iconName = "close"
258
247
/>
259
- </ View >
260
- ) : (
261
- < View style = { { padding : 30 } } >
262
- { ! isPast ( ) && (
263
- < ButtonsRowContainerLeft >
264
- { isParticipant ? (
265
- applied ? (
266
- < AppliedContainer >
267
- < TextLine >
268
- < ApplicationStatus >
269
- Your application is:
270
- </ ApplicationStatus >
271
- < InformativeChip
272
- name = { applicationStatus }
273
- backgroundColor = { getColorForApplicationStatus (
274
- applicationStatus ,
275
- ) }
276
- />
277
- </ TextLine >
278
- </ AppliedContainer >
279
- ) : (
248
+ </ ButtonsRowContainerLeft >
249
+ < EventForm
250
+ inputs = { inputs }
251
+ setInputs = { setInputs }
252
+ createTheEvent = { updateTheEvent }
253
+ isUpdate
254
+ />
255
+ </ View >
256
+ ) : (
257
+ < View style = { { padding : 30 } } >
258
+ { ! isPast ( ) && (
259
+ < ButtonsRowContainerLeft >
260
+ { isParticipant ? (
261
+ applied ? (
262
+ < AppliedContainer >
263
+ < TextLine >
264
+ < ApplicationStatus >
265
+ Your application is:
266
+ </ ApplicationStatus >
267
+ < InformativeChip
268
+ name = { applicationStatus }
269
+ backgroundColor = { getColorForApplicationStatus (
270
+ applicationStatus ,
271
+ ) }
272
+ />
273
+ </ TextLine >
274
+ </ AppliedContainer >
275
+ ) : (
276
+ < Button
277
+ title = "Apply now"
278
+ onPress = { ( ) => {
279
+ applyToEvent ( ) ;
280
+ } }
281
+ color = { systemColors . action }
282
+ />
283
+ )
284
+ ) : isEditable ? null : (
285
+ < >
286
+ { ( isOrganizer || isOrganizerAdmin ) && (
280
287
< Button
281
- title = "Apply now "
288
+ title = "Edit "
282
289
onPress = { ( ) => {
283
- applyToEvent ( ) ;
290
+ setIsEditable ( true ) ;
284
291
} }
285
- color = { systemColors . action }
292
+ color = { systemColors . edit }
293
+ iconName = "pencil"
286
294
/>
287
- )
288
- ) : isEditable ? null : (
289
- < >
290
- { ( isOrganizer || isOrganizerAdmin ) && (
291
- < Button
292
- title = "Edit"
293
- onPress = { ( ) => {
294
- setIsEditable ( true ) ;
295
- } }
296
- color = { systemColors . edit }
297
- iconName = "pencil"
298
- />
299
- ) }
300
- { isOrganizerAdmin && (
301
- < Button
302
- title = "Delete"
303
- onPress = { ( ) => {
304
- setShowAlert ( true ) ;
305
- } }
306
- color = { systemColors . destroy }
307
- iconName = "trash"
308
- />
309
- ) }
310
- </ >
311
- ) }
312
- </ ButtonsRowContainerLeft >
313
- ) }
314
- < EventDetails event = { events } />
315
- </ View >
316
- ) }
317
- </ View >
295
+ ) }
296
+ { isOrganizerAdmin && (
297
+ < Button
298
+ title = "Delete"
299
+ onPress = { ( ) => {
300
+ setShowAlert ( true ) ;
301
+ } }
302
+ color = { systemColors . destroy }
303
+ iconName = "trash"
304
+ />
305
+ ) }
306
+ </ >
307
+ ) }
308
+ </ ButtonsRowContainerLeft >
309
+ ) }
310
+ < EventDetails event = { events } />
311
+ </ View >
312
+ ) }
318
313
</ View >
319
- ) }
320
- </ View >
321
- ) }
322
- < ConfirmDialog
323
- title = { `Delete ${ events ?. name } ` }
324
- message = "Are you sure about that? This action will not be undone"
325
- onTouchOutside = { ( ) => setShowAlert ( false ) }
326
- visible = { showAlert }
327
- negativeButton = { {
328
- title : "Cancel" ,
329
- onPress : ( ) => {
330
- setShowAlert ( false ) ;
331
- } ,
332
- titleStyle : {
333
- color : "red" ,
334
- fontSize : 20 ,
335
- } ,
336
- style : {
337
- backgroundColor : "transparent" ,
338
- paddingHorizontal : 10 ,
339
- } ,
340
- } }
341
- positiveButton = { {
342
- title : "Delete!" ,
343
- onPress : ( ) => {
344
- deleteThisEvent ( ) ;
345
- } ,
346
- titleStyle : {
347
- color : "blue" ,
348
- fontSize : 20 ,
349
- } ,
350
- style : {
351
- backgroundColor : "transparent" ,
352
- paddingHorizontal : 10 ,
353
- } ,
354
- } }
355
- contentInsetAdjustmentBehavior = "automatic"
356
- onRequestClose = { ( ) => setShowAlert ( false ) }
357
- dialogStyle = { {
358
- width : 300 ,
359
- marginRight : "auto" ,
360
- marginLeft : "auto" ,
361
- marginTop : 0 ,
362
- marginBottom : 0 ,
363
- } }
364
- />
365
- </ ScrollView >
366
- </ KeyboardAvoidingView >
314
+ </ View >
315
+ ) }
316
+ </ View >
317
+ ) }
318
+ < ConfirmDialog
319
+ title = { `Delete ${ events ?. name } ` }
320
+ message = "Are you sure about that? This action will not be undone"
321
+ onTouchOutside = { ( ) => setShowAlert ( false ) }
322
+ visible = { showAlert }
323
+ negativeButton = { {
324
+ title : "Cancel" ,
325
+ onPress : ( ) => {
326
+ setShowAlert ( false ) ;
327
+ } ,
328
+ titleStyle : {
329
+ color : "red" ,
330
+ fontSize : 20 ,
331
+ } ,
332
+ style : {
333
+ backgroundColor : "transparent" ,
334
+ paddingHorizontal : 10 ,
335
+ } ,
336
+ } }
337
+ positiveButton = { {
338
+ title : "Delete!" ,
339
+ onPress : ( ) => {
340
+ deleteThisEvent ( ) ;
341
+ } ,
342
+ titleStyle : {
343
+ color : "blue" ,
344
+ fontSize : 20 ,
345
+ } ,
346
+ style : {
347
+ backgroundColor : "transparent" ,
348
+ paddingHorizontal : 10 ,
349
+ } ,
350
+ } }
351
+ contentInsetAdjustmentBehavior = "automatic"
352
+ onRequestClose = { ( ) => setShowAlert ( false ) }
353
+ dialogStyle = { {
354
+ width : 300 ,
355
+ marginRight : "auto" ,
356
+ marginLeft : "auto" ,
357
+ marginTop : 0 ,
358
+ marginBottom : 0 ,
359
+ } }
360
+ / >
361
+ </ ScrollView >
367
362
< Toast />
368
363
</ Container >
369
364
) ;
0 commit comments