1 |
04928342
|
Schwobik
|
import { Center, HStack, Image, Pressable, Text, VStack } from "native-base"
|
2 |
e49b1f44
|
Schwobik
|
import { useEffect } from "react"
|
3 |
04928342
|
Schwobik
|
import { DrawerScreenProps } from "@react-navigation/drawer"
|
4 |
|
|
import { RootDrawerParamList } from "../Navigation"
|
5 |
9c55d3bb
|
Schwobik
|
|
6 |
|
|
interface ItemPreviewProps {
|
7 |
|
|
caption: string
|
8 |
|
|
title: string
|
9 |
ca53e9f1
|
Schwobik
|
name?: string
|
10 |
|
|
image?: string
|
11 |
04928342
|
Schwobik
|
itemId: string
|
12 |
|
|
navigation: any
|
13 |
9c55d3bb
|
Schwobik
|
}
|
14 |
|
|
|
15 |
|
|
const ItemPreview = (props: ItemPreviewProps) => {
|
16 |
|
|
|
17 |
e49b1f44
|
Schwobik
|
useEffect(() => {
|
18 |
|
|
console.log("ItemPreview", "Props:", props)
|
19 |
|
|
}, [props])
|
20 |
|
|
|
21 |
9c55d3bb
|
Schwobik
|
return (
|
22 |
|
|
<>
|
23 |
04928342
|
Schwobik
|
<Pressable
|
24 |
|
|
onPress={() => props.navigation.navigate("Item", {itemId: props.itemId})}
|
25 |
|
|
key={props.itemId}
|
26 |
ca53e9f1
|
Schwobik
|
>
|
27 |
04928342
|
Schwobik
|
<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>{ props.caption }</Text>
|
40 |
|
|
<Text fontSize={"xs"}>{ props.title }</Text>
|
41 |
|
|
</VStack>
|
42 |
|
|
</HStack>
|
43 |
|
|
</Pressable>
|
44 |
9c55d3bb
|
Schwobik
|
</>
|
45 |
|
|
)
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
export default ItemPreview
|