feat: implement search via tmdb package

This commit is contained in:
Adrian Castro
2024-02-04 16:14:16 +01:00
parent b4e9ff5086
commit e3f74aac09
5 changed files with 67 additions and 24 deletions

View File

@@ -1,25 +1,25 @@
import { Image, View } from "react-native";
import { TMDB_POSTER_PATH } from "~/app/constants/General";
import { Text } from "~/components/ui/Text";
export default function Item() {
export default function Item({ data }: { data: { title: string, type: string, year: number, posterUrl: string } }) {
const { title, type, year, posterUrl } = data;
return (
<View className="w-full">
<View className="mb-2 aspect-[9/14] w-full overflow-hidden rounded-2xl">
<Image
source={{
uri: `${TMDB_POSTER_PATH}/w342//gdIrmf2DdY5mgN6ycVP0XlzKzbE.jpg`,
uri: posterUrl,
width: 200,
}}
className="h-full w-full object-cover"
/>
</View>
<Text className="font-bold">Hamilton</Text>
<Text className="font-bold">{title}</Text>
<View className="flex-row items-center gap-3">
<Text className="text-xs text-gray-600">Movie</Text>
<Text className="text-xs text-gray-600">{type}</Text>
<View className="h-1 w-1 rounded-3xl bg-gray-600" />
<Text className="text-sm text-gray-600">2023</Text>
<Text className="text-sm text-gray-600">{year}</Text>
</View>
</View>
);