Add child title to subpages (#448)

Snyggt!
This commit is contained in:
Viktor Sarström 2021-09-01 09:18:58 +02:00 committed by GitHub
parent 29be7debc2
commit f490d98e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import { Calendar } from './calendar.component'
import { ChildProvider } from './childContext.component'
import { Menu } from './menu.component'
import { RootStackParamList } from './navigation.component'
import { NavigationTitle } from './navigationTitle.component'
import { NewsList } from './newsList.component'
import { NotificationsList } from './notificationsList.component'
@ -108,9 +109,13 @@ export const childRouteOptions = ({
}: {
route: RouteProp<RootStackParamList, 'Child'>
}): NativeStackNavigationOptions => {
const { child } = route.params
return {
...defaultStackStyling,
title: getHeaderTitle(route),
headerCenter: () => (
<NavigationTitle title={getHeaderTitle(route)} subtitle={child?.name} />
),
}
}