2022-10-23 06:13:58 +00:00
|
|
|
import {DrawerNavigationProp} from '@react-navigation/drawer';
|
2022-10-22 23:35:58 +00:00
|
|
|
import {useNavigation} from '@react-navigation/native';
|
|
|
|
import React from 'react';
|
|
|
|
import {Appbar, IconButton} from 'react-native-paper';
|
|
|
|
import {DrawerParamList} from './drawer-param-list';
|
|
|
|
import DrawerMenu from './DrawerMenu';
|
|
|
|
|
2022-10-23 06:13:58 +00:00
|
|
|
export default function DrawerHeader({name}: {name: keyof DrawerParamList}) {
|
|
|
|
const navigation = useNavigation<DrawerNavigationProp<DrawerParamList>>();
|
2022-10-22 23:35:58 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Appbar.Header>
|
2022-10-23 06:13:58 +00:00
|
|
|
<IconButton icon="menu" onPress={navigation.openDrawer} />
|
2022-10-22 23:35:58 +00:00
|
|
|
<Appbar.Content title={name} />
|
|
|
|
<DrawerMenu name={name} />
|
|
|
|
</Appbar.Header>
|
|
|
|
);
|
|
|
|
}
|