11import React , { useEffect , useState } from 'react' ;
2- import { SafeAreaView , StyleSheet } from 'react-native' ;
2+ import { SafeAreaView , StyleSheet , View } from 'react-native' ;
33import { useApi } from '../Api/ApiContextProvider' ;
44import { AttendableType } from '../Api/Models/Attendance' ;
55import { Permission } from '../Api/Models/Permission' ;
@@ -48,30 +48,32 @@ function AttendanceScreen() {
4848
4949 return (
5050 < SafeAreaView style = { [ styles . container , { backgroundColor : currentTheme . background } ] } >
51- { attendanceType === AttendableType . NONE ? (
52- < >
53- < MenuHeader title = { 'What do you want to take attendance for?' } > </ MenuHeader >
54- < MenuLink
55- title = "Team"
56- icon = "group"
57- onClick = { ( ) => {
58- setAttendanceType ( AttendableType . TEAM ) ;
59- } }
60- > </ MenuLink >
61- < MenuLink
62- title = "Event"
63- icon = "event"
64- onClick = { ( ) => {
65- setAttendanceType ( AttendableType . EVENT ) ;
66- } }
67- > </ MenuLink >
68- </ >
69- ) : (
70- < AttendableSelect
71- attendanceType = { attendanceType }
72- setAttendanceType = { setAttendanceType }
73- > </ AttendableSelect >
74- ) }
51+ < View style = { styles . viewContainer } >
52+ { attendanceType === AttendableType . NONE ? (
53+ < >
54+ < MenuHeader title = { 'What do you want to take attendance for?' } > </ MenuHeader >
55+ < MenuLink
56+ title = "Team"
57+ icon = "group"
58+ onClick = { ( ) => {
59+ setAttendanceType ( AttendableType . TEAM ) ;
60+ } }
61+ > </ MenuLink >
62+ < MenuLink
63+ title = "Event"
64+ icon = "event"
65+ onClick = { ( ) => {
66+ setAttendanceType ( AttendableType . EVENT ) ;
67+ } }
68+ > </ MenuLink >
69+ </ >
70+ ) : (
71+ < AttendableSelect
72+ attendanceType = { attendanceType }
73+ setAttendanceType = { setAttendanceType }
74+ > </ AttendableSelect >
75+ ) }
76+ </ View >
7577 </ SafeAreaView >
7678 ) ;
7779 }
@@ -97,7 +99,8 @@ function AttendanceScreen() {
9799}
98100
99101const styles = StyleSheet . create ( {
100- container : { flex : 1 , padding : 10 } ,
102+ container : { flex : 1 } ,
103+ viewContainer : { flex : 1 , padding : 10 } ,
101104} ) ;
102105
103106export default AttendanceScreen ;
0 commit comments