Projekt

Obecné

Profil

Stáhnout (1.1 KB) Statistiky
| Větev: | Tag: | Revize:
1 ca53e9f1 Schwobik
import { Center, HStack, Image, Text, VStack } from "native-base"
2 af8eb9a6 Schwobik
import { useEffect } from "react"
3 9c55d3bb Schwobik
4
interface ItemPreviewProps {
5
    caption: string
6
    title: string
7 ca53e9f1 Schwobik
    name?: string
8
    image?: string
9 9c55d3bb Schwobik
}
10
11
const ItemPreview = (props: ItemPreviewProps) => {
12
13 af8eb9a6 Schwobik
    useEffect(() => {
14
        console.log("ItemPreview", "Props:", props)
15
    }, [props])
16
17 9c55d3bb Schwobik
    return (
18
        <>
19 ca53e9f1 Schwobik
            <HStack
20
                space={ 2 }
21
                flex={ 1 }
22
                alignItems={ "start" }
23
            >
24
                <Image
25 af8eb9a6 Schwobik
                    source={ {uri: `http:/147.228.173.159/static/images/${ props.image ? "thumb-" + props.image : "thumb-Rel-78.png" }`} }
26 ca53e9f1 Schwobik
                    size={ "sm" }
27
                    alt={ props.image ? props.image : "thumb-Rel-78.png" }
28
                />
29 af8eb9a6 Schwobik
                <VStack h={70}>
30
                    <Text fontSize={"sm"} italic>{ props.name }</Text>
31
                    <Text fontSize={"sm"} bold>{ props.caption }</Text>
32
                    <Text fontSize={"xs"}>{ props.title }</Text>
33 ca53e9f1 Schwobik
                </VStack>
34
            </HStack>
35 9c55d3bb Schwobik
        </>
36
    )
37
}
38
39
export default ItemPreview