Skip to content

Commit 51a31d3

Browse files
committed
Fix Attendable Select screen, padding issues
- Changed heading in Attendable Select screen to have correct grammar - Wrapped Attendance Screen component in View and SafeAreaView because padding was not working on iOS when applied directly to SafeAreaView
1 parent 6c17532 commit 51a31d3

2 files changed

Lines changed: 34 additions & 27 deletions

File tree

Attendance/AttendableSelect.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ function AttendableSelect({ attendanceType, setAttendanceType }: AttendanceProps
7373
setAttendanceType(AttendableType.NONE);
7474
}}
7575
/>
76-
<MenuHeader title={`Select an ${attendanceType}`}></MenuHeader>
76+
{attendanceType == AttendableType.EVENT ? (
77+
<MenuHeader title={`Select an ${attendanceType}`}></MenuHeader>
78+
) : (
79+
<MenuHeader title={`Select a ${attendanceType}`}></MenuHeader>
80+
)}
7781
<AttendableList></AttendableList>
7882
</ScrollView>
7983
)}

Attendance/AttendanceScreen.tsx

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from 'react';
2-
import { SafeAreaView, StyleSheet } from 'react-native';
2+
import { SafeAreaView, StyleSheet, View } from 'react-native';
33
import { useApi } from '../Api/ApiContextProvider';
44
import { AttendableType } from '../Api/Models/Attendance';
55
import { 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

99101
const styles = StyleSheet.create({
100-
container: { flex: 1, padding: 10 },
102+
container: { flex: 1 },
103+
viewContainer: { flex: 1, padding: 10 },
101104
});
102105

103106
export default AttendanceScreen;

0 commit comments

Comments
 (0)