Add AppHeader component

This commit is contained in:
thesn10
2026-07-02 22:40:40 +02:00
parent d766483120
commit 563054ef02

View File

@@ -0,0 +1,25 @@
import type { JSX } from "react";
import { Pressable, View } from "react-native";
import { useRouter } from "expo-router";
import { Ionicons } from "@expo/vector-icons";
import { Typography, useThemeColor } from "heroui-native";
interface AppHeaderProps {
title: string;
}
export function AppHeader({ title }: AppHeaderProps): JSX.Element {
const router = useRouter();
const foreground = useThemeColor("foreground");
return (
<View className="flex-row items-center gap-2 px-4 py-3 md:hidden">
<Pressable onPress={() => router.back()} hitSlop={8} className="p-1">
<Ionicons name="chevron-back" size={22} color={foreground} />
</Pressable>
<Typography type="h6" numberOfLines={1} className="flex-1">
{title}
</Typography>
</View>
);
}