mirror of
https://github.com/SrIzan10/featheroom.git
synced 2026-06-27 19:02:22 +00:00
28 lines
745 B
TypeScript
28 lines
745 B
TypeScript
import { DrawerHeaderProps as BaseProps } from '@react-navigation/drawer'
|
|
import { getHeaderTitle } from '@react-navigation/elements'
|
|
import React from 'react'
|
|
import { Appbar, AppbarProps } from 'react-native-paper'
|
|
|
|
interface DrawerHeaderProps extends AppbarProps {
|
|
navProps: BaseProps
|
|
}
|
|
|
|
const DrawerHeader = (props: DrawerHeaderProps) => (
|
|
<Appbar.Header {...props}>
|
|
<Appbar.Action
|
|
icon="menu"
|
|
onPress={() => props.navProps.navigation.openDrawer()}
|
|
/>
|
|
|
|
<Appbar.Content
|
|
title={getHeaderTitle(props.navProps.options, props.navProps.route.name)}
|
|
/>
|
|
|
|
{props.navProps.options.headerRight
|
|
? props.navProps.options.headerRight({})
|
|
: undefined}
|
|
</Appbar.Header>
|
|
)
|
|
|
|
export default DrawerHeader
|