fix: adjust margins and typography on start page

This commit is contained in:
Christian Landgren 2021-09-04 00:28:49 +02:00
parent 616362d14b
commit aea0b5264b
3 changed files with 63 additions and 32 deletions

View File

@ -147,11 +147,14 @@ export const ChildListItem = ({ child, color }: ChildListItemProps) => {
</Text> </Text>
)} )}
<Text category="c2" style={styles.label}> {!menu[moment().isoWeekday() - 1] ? null : (
{translate('schedule.lunch')} <>
</Text> <Text category="c2" style={styles.label}>
<Text>{menu[moment().isoWeekday() - 1]?.description}</Text> {translate('schedule.lunch')}
</Text>
<Text>{menu[moment().isoWeekday() - 1]?.description}</Text>
</>
)}
<View style={styles.itemFooterAbsence}> <View style={styles.itemFooterAbsence}>
<Button <Button
accessible accessible
@ -160,6 +163,7 @@ export const ChildListItem = ({ child, color }: ChildListItemProps) => {
appearance="ghost" appearance="ghost"
accessoryLeft={AlertIcon} accessoryLeft={AlertIcon}
status="" status=""
style={styles.absenceButton}
onPress={() => navigation.navigate('Absence', { child })} onPress={() => navigation.navigate('Absence', { child })}
> >
{translate('abscense.title')} {translate('abscense.title')}
@ -212,6 +216,9 @@ const themeStyles = StyleService.create({
...Layout.mainAxis.flexStart, ...Layout.mainAxis.flexStart,
marginTop: Sizing.t4, marginTop: Sizing.t4,
}, },
absenceButton: {
marginLeft: -20,
},
item: { item: {
marginRight: 12, marginRight: 12,
paddingHorizontal: 2, paddingHorizontal: 2,

View File

@ -33,27 +33,47 @@ export const DaySummary = ({ child, date = moment() }: DaySummaryProps) => {
const gymBag = lessons.some((lesson) => lesson.code === 'IDH') const gymBag = lessons.some((lesson) => lesson.code === 'IDH')
return ( return (
<> <View style={styles.summary}>
<Text category="c2" style={styles.label}> <View style={styles.part}>
{translate('schedule.start')} - {translate('schedule.end')} <View>
</Text> <Text category="c2" style={styles.label}>
{translate('schedule.start')}
<View style={styles.summary}> </Text>
<Text category="s1"> <Text category="h5">{lessons[0].timeStart.slice(0, 5)} - </Text>
{lessons[0].timeStart.slice(0, 5)}- </View>
{lessons[lessons.length - 1].timeEnd.slice(0, 5)}
{gymBag
? ` (🤼‍♀️ ${translate('schedule.gymBag', {
defaultValue: 'Gympapåse',
})})`
: ''}
</Text>
</View> </View>
</> <View style={styles.part}>
<View>
<Text category="c2" style={styles.label}>
{translate('schedule.end')}
</Text>
<Text category="h5">
{lessons[lessons.length - 1].timeEnd.slice(0, 5)}
</Text>
</View>
</View>
<View style={styles.part}>
<View>
<Text category="c2" style={styles.label}>
&nbsp;
</Text>
<Text category="s2">
{gymBag
? ` 🤼‍♀️ ${translate('schedule.gymBag', {
defaultValue: 'Gympapåse',
})}`
: ''}
</Text>
</View>
</View>
</View>
) )
} }
const themedStyles = StyleService.create({ const themedStyles = StyleService.create({
part: {
flexDirection: 'column',
},
summary: { summary: {
flexDirection: 'row', flexDirection: 'row',
}, },

View File

@ -59,16 +59,17 @@ const LessonList = ({ lessons, header, lunch }: LessonListProps) => {
</View> </View>
)} )}
description={() => ( description={() => (
<Text <View style={styles.lesson}>
style={styles.lessonDescription} <Text
maxFontSizeMultiplier={1} style={styles.lessonDescription}
>{`${timeStart.slice(0, 5)}-${timeEnd.slice(0, 5)} ${ maxFontSizeMultiplier={1}
code === 'Lunch' >{`${timeStart.slice(0, 5)}-${timeEnd.slice(0, 5)} (${
? lunch?.description location
: location })`}</Text>
? `(${location})` <Text style={styles.lessonDescription} maxFontSizeMultiplier={1}>
: '' {code === 'Lunch' ? lunch?.description : teacher}
} ${teacher}`}</Text> </Text>
</View>
)} )}
/> />
)} )}
@ -166,7 +167,7 @@ const themedStyles = StyleService.create({
padding: 0, padding: 0,
}, },
item: { item: {
height: 45, height: 55,
backgroundColor: 'background-basic-color-2', backgroundColor: 'background-basic-color-2',
paddingHorizontal: 0, paddingHorizontal: 0,
borderRadius: 2, borderRadius: 2,
@ -213,4 +214,7 @@ const themedStyles = StyleService.create({
lessonDescription: { lessonDescription: {
fontSize: 13, fontSize: 13,
}, },
lesson: {
flexDirection: 'column',
}
}) })