Revize 191f2cc7
Přidáno uživatelem Fantič před asi 2 roky(ů)
src/components/item/ItemTabBar.tsx | ||
---|---|---|
25 | 25 |
</HStack> |
26 | 26 |
<HStack marginRight={0}> |
27 | 27 |
<Button variant="ghost" size="lg" |
28 |
onPress={() => onIndexChange(index-1)}
|
|
28 |
onPress={() => onIndexChange(index - 1)}
|
|
29 | 29 |
leftIcon={<ChevronLeftIcon size="lg" />}> |
30 | 30 |
</Button> |
31 | 31 |
<Button variant="ghost" size="lg" |
32 |
onPress={() => onIndexChange(index+1)}
|
|
32 |
onPress={() => onIndexChange(index + 1)}
|
|
33 | 33 |
leftIcon={<ChevronRightIcon size="lg" />}> |
34 | 34 |
</Button> |
35 | 35 |
</HStack> |
36 | 36 |
</HStack> |
37 | 37 |
</HStack> |
38 |
<View h="12">
|
|
38 |
<View h="8">
|
|
39 | 39 |
<ScrollView contentContainerStyle={{ flexGrow: 1 }} flex="1" horizontal={true}> |
40 | 40 |
{props.navigationState.routes.length > 1 ? ( |
41 |
<HStack> |
|
41 |
<HStack borderBottomWidth={1} flex="1" borderColor="light.400">
|
|
42 | 42 |
{props.navigationState.routes.map((route, i) => { |
43 | 43 |
return ( |
44 |
<Button |
|
45 |
size="lg" |
|
46 |
key={i} |
|
47 |
variant={index == i ? "subtle" : "outline"} |
|
48 |
rightIcon={ |
|
44 |
<Pressable key={i} onPress={() => { onIndexChange(i) }}> |
|
45 |
<HStack alignItems={"center"} width="32" borderColor="light.400" height="100%" borderBottomWidth={i == index ? 2 : 0}> |
|
49 | 46 |
<CircleIcon |
47 |
marginLeft="20%" |
|
50 | 48 |
size="2" |
51 | 49 |
color={CertaintyWithColors[concordances[i].cert].color} |
52 | 50 |
/> |
53 |
} |
|
54 |
onPress={() => {onIndexChange(i)}} |
|
55 |
> |
|
56 |
{concordances[i].id} |
|
57 |
</Button> |
|
51 |
<Text marginLeft="5%"> |
|
52 |
{i == index ? <Text bold>{concordances[i].id}</Text> : concordances[i].id} |
|
53 |
|
|
54 |
</Text> |
|
55 |
</HStack> |
|
56 |
</Pressable> |
|
58 | 57 |
); |
59 | 58 |
})} |
60 | 59 |
</HStack> |
61 | 60 |
) : ( |
62 | 61 |
// One item only |
63 |
<Button |
|
64 |
flex="1" |
|
65 |
variant={"outline"} |
|
66 |
size="md" |
|
67 |
rightIcon={ |
|
68 |
<ChevronLeftIcon |
|
69 |
size="2" |
|
70 |
color={CertaintyWithColors[concordances[0].cert].color} |
|
71 |
/> |
|
72 |
} |
|
73 |
> |
|
74 |
{concordances[0].id} |
|
75 |
</Button> |
|
62 |
<Pressable onPress={() => { onIndexChange(0) }} width="100%"> |
|
63 |
<HStack alignItems={"center"} width="100%" borderColor="light.400" height="100%" borderBottomWidth={2}> |
|
64 |
<CircleIcon |
|
65 |
marginLeft="42%" |
|
66 |
size="2" |
|
67 |
color={CertaintyWithColors[concordances[0].cert].color} |
|
68 |
/> |
|
69 |
<Text marginLeft="2%"> |
|
70 |
<Text bold>{concordances[0].id}</Text> |
|
71 |
</Text> |
|
72 |
</HStack> |
|
73 |
</Pressable> |
|
76 | 74 |
)} |
77 | 75 |
</ScrollView> |
78 | 76 |
</View> |
src/components/item/ItemView.tsx | ||
---|---|---|
61 | 61 |
<Card shadow="1" marginTop="5%" marginBottom="5%"> |
62 | 62 |
{item.authorName && |
63 | 63 |
<HStack> |
64 |
<Text italic> |
|
64 |
<Text italic marginTop="2.5%">
|
|
65 | 65 |
<Text color="light.500">Author name: </Text> |
66 | 66 |
{item.authorName} |
67 | 67 |
</Text> |
68 | 68 |
</HStack>} |
69 | 69 |
{item.title && |
70 | 70 |
<HStack> |
71 |
<Text italic> |
|
71 |
<Text italic marginTop="2.5%">
|
|
72 | 72 |
<Text color="light.500">Title: </Text> |
73 | 73 |
{item.title} |
74 | 74 |
</Text> |
75 | 75 |
</HStack>} |
76 | 76 |
{item.institution && |
77 | 77 |
<HStack> |
78 |
<Text italic> |
|
78 |
<Text italic marginTop="2.5%">
|
|
79 | 79 |
<Text color="light.500">Institution: </Text> |
80 | 80 |
{item.institution.name}, Inv. No. {item.institution.inventoryNumber}, {item.institution.city} {"(" + item.institution.country + ")"} |
81 | 81 |
</Text> |
82 | 82 |
</HStack>} |
83 | 83 |
{item.repository && |
84 | 84 |
<HStack> |
85 |
<Text italic> |
|
85 |
<Text italic marginTop="2.5%">
|
|
86 | 86 |
<Text color="light.500">Repository: </Text> |
87 | 87 |
{item.repository} |
88 | 88 |
</Text> |
89 | 89 |
</HStack>} |
90 | 90 |
{item.provenance && |
91 | 91 |
<HStack> |
92 |
<Text italic> |
|
92 |
<Text italic marginTop="2.5%">
|
|
93 | 93 |
<Text color="light.500">Provenance: </Text> |
94 | 94 |
{item.provenance} |
95 | 95 |
</Text> |
96 | 96 |
</HStack>} |
97 | 97 |
{item.description && |
98 | 98 |
<HStack> |
99 |
<Text italic> |
|
99 |
<Text italic marginTop ="2.5%">
|
|
100 | 100 |
<Text color="light.500">Description: </Text> |
101 | 101 |
{item.description} |
102 | 102 |
</Text> |
Také k dispozici: Unified diff
re #10454: ItemView: ItemTabBar update