fix: hide start-end if we have no schedule
This commit is contained in:
parent
b05dc42a94
commit
616362d14b
|
@ -120,11 +120,6 @@ export const ChildListItem = ({ child, color }: ChildListItemProps) => {
|
|||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<Text category="c2" style={styles.label}>
|
||||
{translate('schedule.start')} - {translate('schedule.end')}
|
||||
</Text>
|
||||
|
||||
<DaySummary child={child} />
|
||||
{scheduleAndCalendarThisWeek.slice(0, 3).map((calendarItem, i) => (
|
||||
<Text category="p1" key={i}>
|
||||
|
|
|
@ -33,17 +33,23 @@ export const DaySummary = ({ child, date = moment() }: DaySummaryProps) => {
|
|||
const gymBag = lessons.some((lesson) => lesson.code === 'IDH')
|
||||
|
||||
return (
|
||||
<View style={styles.summary}>
|
||||
<Text category="s1">
|
||||
{lessons[0].timeStart.slice(0, 5)}-
|
||||
{lessons[lessons.length - 1].timeEnd.slice(0, 5)}
|
||||
{gymBag
|
||||
? ` (🤼♀️ ${translate('schedule.gymBag', {
|
||||
defaultValue: 'Gympapåse',
|
||||
})})`
|
||||
: ''}
|
||||
<>
|
||||
<Text category="c2" style={styles.label}>
|
||||
{translate('schedule.start')} - {translate('schedule.end')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={styles.summary}>
|
||||
<Text category="s1">
|
||||
{lessons[0].timeStart.slice(0, 5)}-
|
||||
{lessons[lessons.length - 1].timeEnd.slice(0, 5)}
|
||||
{gymBag
|
||||
? ` (🤼♀️ ${translate('schedule.gymBag', {
|
||||
defaultValue: 'Gympapåse',
|
||||
})})`
|
||||
: ''}
|
||||
</Text>
|
||||
</View>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -51,4 +57,7 @@ const themedStyles = StyleService.create({
|
|||
summary: {
|
||||
flexDirection: 'row',
|
||||
},
|
||||
label: {
|
||||
marginTop: 10,
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue