Massive/StackHeader.tsx

24 lines
481 B
TypeScript
Raw Normal View History

2023-06-27 03:16:59 +00:00
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[]
}) {
2022-10-31 04:22:08 +00:00
const navigation = useNavigation()
return (
<Appbar.Header>
<IconButton
2023-06-27 03:16:59 +00:00
icon='arrow-back'
onPress={navigation.goBack}
/>
<Appbar.Content title={title} />
2023-03-27 23:04:54 +00:00
{children}
</Appbar.Header>
2022-10-31 04:22:08 +00:00
)
}