2023-08-12 03:22:50 +00:00
|
|
|
import { DrawerNavigationProp } from "@react-navigation/drawer";
|
|
|
|
import { useNavigation } from "@react-navigation/native";
|
|
|
|
import { Appbar, IconButton } from "react-native-paper";
|
|
|
|
import { DrawerParamList } from "./drawer-param-list";
|
2022-10-22 23:35:58 +00:00
|
|
|
|
2022-12-13 09:54:37 +00:00
|
|
|
export default function DrawerHeader({
|
|
|
|
name,
|
2022-12-18 00:23:10 +00:00
|
|
|
children,
|
2022-12-13 09:54:37 +00:00
|
|
|
}: {
|
2023-08-12 03:22:50 +00:00
|
|
|
name: string;
|
|
|
|
children?: JSX.Element | JSX.Element[];
|
2022-12-13 09:54:37 +00:00
|
|
|
}) {
|
2023-08-12 03:22:50 +00:00
|
|
|
const navigation = useNavigation<DrawerNavigationProp<DrawerParamList>>();
|
2022-10-22 23:35:58 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Appbar.Header>
|
2023-08-12 03:22:50 +00:00
|
|
|
<IconButton icon="menu" onPress={navigation.openDrawer} />
|
2022-10-22 23:35:58 +00:00
|
|
|
<Appbar.Content title={name} />
|
2022-12-18 00:23:10 +00:00
|
|
|
{children}
|
2022-10-22 23:35:58 +00:00
|
|
|
</Appbar.Header>
|
2023-08-12 03:22:50 +00:00
|
|
|
);
|
2022-10-22 23:35:58 +00:00
|
|
|
}
|