Massive/StackHeader.tsx

21 lines
465 B
TypeScript
Raw Permalink Normal View History

import { useNavigation } from "@react-navigation/native";
import { Appbar, IconButton } from "react-native-paper";
2023-03-27 23:04:54 +00:00
export default function StackHeader({
title,
children,
}: {
title: string;
children?: JSX.Element | JSX.Element[];
2023-03-27 23:04:54 +00:00
}) {
const navigation = useNavigation();
return (
<Appbar.Header>
2023-10-19 05:28:56 +00:00
<IconButton icon="arrow-left" onPress={navigation.goBack} />
<Appbar.Content title={title} />
2023-03-27 23:04:54 +00:00
{children}
</Appbar.Header>
);
}