diff --git a/apps/skolplattformen-app/components/child.component.tsx b/apps/skolplattformen-app/components/child.component.tsx index c7985cb6..cfc05358 100644 --- a/apps/skolplattformen-app/components/child.component.tsx +++ b/apps/skolplattformen-app/components/child.component.tsx @@ -139,7 +139,10 @@ const TabNavigator = ({ ) const getHeaderTitle = (route: any) => { - const routeName = getFocusedRouteNameFromRoute(route) ?? 'News' + const routeName = + getFocusedRouteNameFromRoute(route) ?? + route.params.initialRouteName ?? + 'News' return getRouteTitleFromName(routeName) } diff --git a/apps/skolplattformen-app/components/childListItem.component.tsx b/apps/skolplattformen-app/components/childListItem.component.tsx index 8ca199f5..4ec4d97c 100644 --- a/apps/skolplattformen-app/components/childListItem.component.tsx +++ b/apps/skolplattformen-app/components/childListItem.component.tsx @@ -18,7 +18,7 @@ import { } from '@ui-kitten/components' import moment, { Moment } from 'moment' import React, { useEffect } from 'react' -import { TouchableOpacity, useColorScheme, View } from 'react-native' +import { Pressable, useColorScheme, View } from 'react-native' import { useTranslation } from '../hooks/useTranslation' import { Colors, Layout, Sizing } from '../styles' import { getMeaningfulStartingDate } from '../utils/calendarHelpers' @@ -157,11 +157,15 @@ export const ChildListItem = ({ ) return ( - navigation.navigate('Child', { child, color })} - > - - + + + [ + styles.cardHeaderLeft || {}, + { opacity: pressed ? 0.5 : 1 }, + ]} + onPress={() => navigation.navigate('Child', { child, color })} + > @@ -178,16 +182,37 @@ export const ChildListItem = ({ name="star" /> - + + + ['' || {}, { opacity: pressed ? 0.5 : 1 }]} + onPress={() => + navigation.navigate('Child', { + child, + color, + initialRouteName: 'Calendar', + }) + } + > - {scheduleAndCalendarThisWeek.slice(0, 3).map((calendarItem, i) => ( {`${calendarItem.title} (${displayDate(calendarItem.startDate)})`} ))} + + ['' || {}, { opacity: pressed ? 0.5 : 1 }]} + onPress={() => + navigation.navigate('Child', { + child, + color, + initialRouteName: 'News', + }) + } + > {t('navigation.news')} @@ -202,43 +227,52 @@ export const ChildListItem = ({ {newsItem.header ?? ''} ))} + - {scheduleAndCalendarThisWeek.length || - notificationsThisWeek.length || - newsThisWeek.length ? null : ( - - {t('news.noNewNewsItemsThisWeek')} + {scheduleAndCalendarThisWeek.length || + notificationsThisWeek.length || + newsThisWeek.length ? null : ( + + {t('news.noNewNewsItemsThisWeek')} + + )} + {shouldShowLunchMenu ? ( + ['' || {}, { opacity: pressed ? 0.5 : 1 }]} + onPress={() => + navigation.navigate('Child', { + child, + color, + initialRouteName: 'Menu', + }) + } + > + + {meaningfulStartingDate.format( + '[' + t('schedule.lunch') + '] dddd' + )} - )} - {shouldShowLunchMenu ? ( - <> - - {meaningfulStartingDate.format( - '[' + t('schedule.lunch') + '] dddd' - )} - - - {menu[meaningfulStartingDate.isoWeekday() - 1]?.description} - - - ) : null} + + {menu[meaningfulStartingDate.isoWeekday() - 1]?.description} + + + ) : null} - - - + + - + ) } diff --git a/apps/skolplattformen-app/components/navigationTitle.component.tsx b/apps/skolplattformen-app/components/navigationTitle.component.tsx index 1b7dbba9..5543175b 100644 --- a/apps/skolplattformen-app/components/navigationTitle.component.tsx +++ b/apps/skolplattformen-app/components/navigationTitle.component.tsx @@ -19,7 +19,11 @@ export const NavigationTitle = ({ title, subtitle }: NavigationTitleProps) => { {title} )} - {subtitle && {subtitle}} + {subtitle && ( + + {subtitle.substring(0, subtitle.indexOf(' '))} + + )} ) } @@ -32,5 +36,5 @@ const styles = StyleSheet.create({ ...fontSize.sm, fontWeight: '500', }, - subtitle: { ...fontSize.xxs }, + subtitle: { ...fontSize.base }, })