feat: add video player

This commit is contained in:
Adrian Castro
2024-02-04 22:45:30 +01:00
parent 0728ab6b49
commit 55be0860b9
4 changed files with 97 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { Image, View } from "react-native";
import { useRouter } from "expo-router";
import { Image, View, TouchableOpacity } from "react-native";
import { Text } from "~/components/ui/Text";
@@ -11,10 +12,18 @@ export interface ItemData {
}
export default function Item({ data }: { data: ItemData }) {
const router = useRouter();
const { title, type, year, posterUrl } = data;
const handlePress = () => {
console.log('Item pressed. Opening VideoPlayer...');
router.push('/video-player');
};
return (
<View className="w-full">
<TouchableOpacity onPress={handlePress} style={{ width: '100%' }}>
{
<View className="w-full">
<View className="mb-2 aspect-[9/14] w-full overflow-hidden rounded-2xl">
<Image
source={{
@@ -32,5 +41,7 @@ export default function Item({ data }: { data: ItemData }) {
<Text className="text-sm text-gray-600">{year}</Text>
</View>
</View>
}
</TouchableOpacity>
);
}