Revize ca53e9f1
Přidáno uživatelem Schwobik před téměř 2 roky(ů)
src/components/listView/ListView.tsx | ||
---|---|---|
1 | 1 |
import { useEffect, useState } from "react" |
2 |
import { Text } from "native-base"
|
|
2 |
import { ScrollView, Text, VStack } from "native-base"
|
|
3 | 3 |
import { useSelector } from "react-redux" |
4 | 4 |
import { RootState } from "../../stores/store" |
5 |
import ItemPreview from "./ItemPreview" |
|
5 | 6 | |
6 | 7 |
const ListView = () => { |
7 | 8 |
const items = useSelector((state: RootState) => state.listView.data) |
8 | 9 | |
9 | 10 |
return ( |
10 |
<> |
|
11 |
<Text>ListView</Text> |
|
12 |
</> |
|
11 |
<VStack |
|
12 |
space={ 2 } |
|
13 |
flex={ 1 } |
|
14 |
p={ 4 } |
|
15 |
alignItems={ "start" } |
|
16 |
> |
|
17 |
{ items.map((item) => ( |
|
18 |
<ItemPreview |
|
19 |
caption={ item.object[0].caption } |
|
20 |
title={ item.text } |
|
21 |
name={ |
|
22 |
item.object[0].name ? |
|
23 |
item.object[0].name[0].getty_data ? |
|
24 |
item.object[0].name[0].getty_data.display_name |
|
25 |
: |
|
26 |
item.object[0].name[0].value |
|
27 |
: |
|
28 |
undefined |
|
29 |
} |
|
30 |
image={ item.object[1] && item.object[1].images && item.object[1].images ? item.object[1].images[0].file : undefined } |
|
31 |
/> |
|
32 |
)) } |
|
33 |
</VStack> |
|
13 | 34 |
) |
14 | 35 |
} |
15 | 36 |
Také k dispozici: Unified diff
Demo of listview implemented
re #10342