1
|
import { Center, HStack, Image, Pressable, ScrollView, Text, VStack } from "native-base"
|
2
|
import { useEffect } from "react"
|
3
|
import { DrawerScreenProps } from "@react-navigation/drawer"
|
4
|
import { RootDrawerParamList } from "../Navigation"
|
5
|
|
6
|
interface ItemPreviewProps {
|
7
|
caption: string
|
8
|
title: string
|
9
|
name?: string
|
10
|
image?: string
|
11
|
itemId: string
|
12
|
navigation: any
|
13
|
}
|
14
|
|
15
|
const ItemPreview = (props: ItemPreviewProps) => {
|
16
|
|
17
|
useEffect(() => {
|
18
|
console.log("ItemPreview", "Props:", props)
|
19
|
}, [props])
|
20
|
|
21
|
return (
|
22
|
<>
|
23
|
<Pressable
|
24
|
onPress={() => props.navigation.navigate("Item", {itemId: props.itemId})}
|
25
|
key={props.itemId}
|
26
|
>
|
27
|
<HStack
|
28
|
space={ 2 }
|
29
|
flex={ 1 }
|
30
|
alignItems={ "start" }
|
31
|
>
|
32
|
<Image
|
33
|
source={ {uri: `http:/147.228.173.159/static/images/${ props.image ? "thumb-" + props.image : "thumb-Rel-78.png" }`} }
|
34
|
size={ "sm" }
|
35
|
alt={ props.image ? props.image : "thumb-Rel-78.png" }
|
36
|
/>
|
37
|
<VStack h={70}>
|
38
|
<Text fontSize={"sm"} italic>{ props.name }</Text>
|
39
|
<Text fontSize={"sm"} bold noOfLines={1}>{ props.caption }</Text>
|
40
|
<Text fontSize={"xs"}>{ props.title }</Text>
|
41
|
</VStack>
|
42
|
</HStack>
|
43
|
</Pressable>
|
44
|
</>
|
45
|
)
|
46
|
}
|
47
|
|
48
|
export default ItemPreview
|