Revize f22a2126
Přidáno uživatelem Michal Schwob před více než 1 rok
src/components/item/ItemView.tsx | ||
---|---|---|
16 | 16 |
import { RootStackParamList } from "../../pages/Navigation" |
17 | 17 |
import { select } from "d3" |
18 | 18 |
import { CertaintyWithColors } from "../../stores/reducers/itemSlice" |
19 |
import RenderHTML from "react-native-render-html" |
|
19 | 20 |
|
20 | 21 |
interface ItemDetailProps { |
21 | 22 |
item: Item, |
... | ... | |
49 | 50 |
<VStack> |
50 | 51 |
<HStack marginLeft={2.5} alignItems={"center"}> |
51 | 52 |
<VStack flex={1} marginTop={3.5}> |
52 |
<Text fontSize={13} color="#4D4D4D">
|
|
53 |
<Text fontSize={13} fontWeight={"light"}>
|
|
53 | 54 |
{item.authorDisplayName ? item.authorDisplayName : item.authorName} |
54 | 55 |
</Text> |
55 |
<Heading marginTop={1} fontSize={18} color="#4D4D4D">
|
|
56 |
<Heading marginTop={1} fontSize={18}> |
|
56 | 57 |
{item.workName} |
57 | 58 |
</Heading> |
58 | 59 |
|
59 | 60 |
</VStack> |
60 | 61 |
<Box marginLeft="auto" marginTop={0}> {/* marginLeft: "auto" pushes the Box to the right */} |
61 |
<Button variant="outline" backgroundColor={"#F4DFAB"} borderRadius={8} size="sm" padding={1.5} >
|
|
62 |
<Text color="#654B07" fontSize={14}>
|
|
62 |
<Button variant="outline" backgroundColor={"secondary.500"} borderRadius={8} size="sm" padding={1.5} >
|
|
63 |
<Text color="primary.500" fontSize={14}>
|
|
63 | 64 |
{item?.concordances?.[0]?.id} |
64 | 65 |
</Text> |
65 | 66 |
</Button> |
... | ... | |
69 | 70 |
|
70 | 71 |
|
71 | 72 |
|
72 |
<View marginTop={5} backgroundColor="#F5F4F1" borderRadius={10} borderColor="#F5F4F1" padding={2}>
|
|
73 |
<View marginTop={5} backgroundColor="primary.100" borderRadius={10} borderColor="primary.100" padding={2}>
|
|
73 | 74 |
{item.inventoryItem && |
74 | 75 |
<VStack> |
75 | 76 |
<Text italic> |
76 |
<Text color="#654B07" italic fontWeight={"semibold"}>Inventory item: </Text>
|
|
77 |
<Text color="primary.500" italic fontWeight={"semibold"}>Inventory item: </Text>
|
|
77 | 78 |
{item.inventoryItem} |
78 | 79 |
</Text> |
79 |
<Text italic marginTop="2.5%">
|
|
80 |
<Text italic marginTop="2"> |
|
80 | 81 |
{item.searchSubjects != undefined && item?.searchSubjects?.map((subject, index) => ( |
81 | 82 |
subject != "" ? |
82 | 83 |
item.searchSubjects && index < item.searchSubjects.length - 1 ? (subject + ", ") : (subject) |
... | ... | |
87 | 88 |
</VStack>} |
88 | 89 |
</View> |
89 | 90 |
{item.fullView && item.images && item.images.length > 0 && ( |
90 |
<VStack marginTop={5} alignItems="center" justifyContent="center" backgroundColor="#F5F4F1" borderRadius={10} borderColor="#F5F4F1" padding={2}>
|
|
91 |
<VStack marginTop={5} alignItems="center" justifyContent="center" backgroundColor="primary.100" borderRadius={10} borderColor="primary.100" padding={2}>
|
|
91 | 92 |
|
92 | 93 |
<Box style={{ backgroundColor: item.images[selectedImage].relationship_type != RelationshipType.IdentifiedArtwork ? "#B3B3B3" : CertaintyWithColors[item.images[selectedImage].cert ?? Certainty.Unknown].color }} |
93 | 94 |
marginTop={2.5} width={Dimensions.get('window').width - 110} alignItems="center" borderTopRadius={10} > |
... | ... | |
131 | 132 |
</VStack> |
132 | 133 |
)} |
133 | 134 |
{item.fullView && ( |
134 |
<View marginTop={5} backgroundColor="#F5F4F1" borderRadius={10} borderColor="#F5F4F1" padding={2} marginBottom={5}>
|
|
135 |
<View marginTop={5} backgroundColor="primary.100" borderRadius={10} borderColor="primary.100" padding={2} marginBottom={5}>
|
|
135 | 136 |
{item.authorName && |
136 | 137 |
<HStack> |
137 | 138 |
<Text marginTop={2.5}> |
138 |
<Text color="#654B07" italic fontWeight={"semibold"}>Author name: </Text>
|
|
139 |
<Text color="primary.500" italic fontWeight={"semibold"}>Author name: </Text>
|
|
139 | 140 |
{item.images?.[selectedImage]?.author} |
140 | 141 |
</Text> |
141 | 142 |
</HStack>} |
142 | 143 |
{item.title && |
143 | 144 |
<HStack> |
144 | 145 |
<Text marginTop={2.5}> |
145 |
<Text color="#654B07" italic fontWeight={"semibold"}>Title: </Text>
|
|
146 |
<Text color="primary.500" italic fontWeight={"semibold"}>Title: </Text>
|
|
146 | 147 |
{item.images?.[selectedImage].title} |
147 | 148 |
</Text> |
148 | 149 |
</HStack>} |
149 | 150 |
{item.institution && |
150 | 151 |
<HStack> |
151 | 152 |
<Text marginTop={2.5}> |
152 |
<Text color="#654B07" italic fontWeight={"semibold"}>Institution: </Text>
|
|
153 |
<Text color="primary.500" italic fontWeight={"semibold"}>Institution: </Text>
|
|
153 | 154 |
{item.images?.[selectedImage].institution.name && `${item.images?.[selectedImage].institution.name}`} |
154 | 155 |
{item.images?.[selectedImage].institution.inventoryNumber && `, Inv. No. ${item.images?.[selectedImage].institution.inventoryNumber}`} |
155 | 156 |
{item.images?.[selectedImage].institution.city && `, ${item.images?.[selectedImage].institution.city}`} |
... | ... | |
159 | 160 |
{item.repository && |
160 | 161 |
<HStack> |
161 | 162 |
<Text marginTop={2.5}> |
162 |
<Text color="#654B07" italic fontWeight={"semibold"}>Repository: </Text>
|
|
163 |
<Text color="primary.500" italic fontWeight={"semibold"}>Repository: </Text>
|
|
163 | 164 |
{item.images?.[selectedImage].repository} |
164 | 165 |
</Text> |
165 | 166 |
</HStack>} |
166 | 167 |
{item.images?.[selectedImage].provenance && |
167 | 168 |
<HStack> |
168 | 169 |
<Text marginTop={2.5}> |
169 |
<Text color="#654B07" italic fontWeight={"semibold"}>Provenance: </Text>
|
|
170 |
<Text color="primary.500" italic fontWeight={"semibold"}>Provenance: </Text>
|
|
170 | 171 |
{item.images?.[selectedImage].provenance} |
171 | 172 |
</Text> |
172 | 173 |
</HStack>} |
173 | 174 |
{item.images?.[selectedImage].description && |
174 | 175 |
<HStack> |
175 | 176 |
<Text marginTop={2.5}> |
176 |
<Text color="#654B07" italic fontWeight={"semibold"}>Description: </Text> |
|
177 |
{item.images?.[selectedImage].description} |
|
177 |
<Text color="primary.500" italic fontWeight={"semibold"}>Description: </Text> |
|
178 | 178 |
</Text> |
179 |
<RenderHTML contentWidth={200} source={{html: item.images?.[selectedImage].description}} /> |
|
179 | 180 |
</HStack>} |
180 | 181 |
</View>)} |
181 | 182 |
|
... | ... | |
185 | 186 |
<Button |
186 | 187 |
onPress={() => props.navigation.navigate("Plan", { roomId: item?.room?.id, placeId: undefined })} |
187 | 188 |
variant={"link"} |
188 |
backgroundColor={"#F4DFAB"}
|
|
189 |
backgroundColor={"secondary.500"}
|
|
189 | 190 |
borderRadius={7} |
190 | 191 |
marginTop={0} |
191 | 192 |
marginBottom={5} |
... | ... | |
254 | 255 |
: |
255 | 256 |
(<VStack> |
256 | 257 |
<Flex direction="row" align="flex-start" justifyContent="space-between" marginTop={2.5} marginLeft={2.5} marginRight={2.5}> |
257 |
<Text fontWeight="semibold" mt={4} ml={2} fontSize="md" color="#4D4D4D">Show related comments</Text>
|
|
258 |
<Text fontWeight="semibold" mt={4} ml={2} fontSize="md" >Show related comments</Text> |
|
258 | 259 |
<Switch value={showRelatedComments} onChange={toggleRelatedComments} size="lg" marginRight={2} /> |
259 | 260 |
</Flex> |
260 | 261 |
<Box > |
Také k dispozici: Unified diff
FIX: colors fix
re #10896