diff --git a/apps/skolplattformen-app/components/childListItem.component.tsx b/apps/skolplattformen-app/components/childListItem.component.tsx index 76e6c67b..8ca199f5 100644 --- a/apps/skolplattformen-app/components/childListItem.component.tsx +++ b/apps/skolplattformen-app/components/childListItem.component.tsx @@ -146,6 +146,16 @@ export const ChildListItem = ({ const styles = useStyleSheet(themeStyles) const isDarkMode = useColorScheme() === 'dark' const meaningfulStartingDate = getMeaningfulStartingDate(currentDate) + + // Hide menu if we want to show monday but it is not monday yet. + // The menu for next week is not available until monday + const shouldShowLunchMenu = + menu[meaningfulStartingDate.isoWeekday() - 1] && + !( + meaningfulStartingDate.isoWeekday() === 1 && + currentDate.isoWeekday() !== 1 + ) + return ( navigation.navigate('Child', { child, color })} @@ -200,14 +210,18 @@ export const ChildListItem = ({ {t('news.noNewNewsItemsThisWeek')} )} - {!menu[currentDate.isoWeekday() - 1] ? null : ( + {shouldShowLunchMenu ? ( <> - {t('schedule.lunch')} + {meaningfulStartingDate.format( + '[' + t('schedule.lunch') + '] dddd' + )} + + + {menu[meaningfulStartingDate.isoWeekday() - 1]?.description} - {menu[currentDate.isoWeekday() - 1]?.description} - )} + ) : null}