|
17 | 17 | class="link" |
18 | 18 | ref="apiChangesDiff" |
19 | 19 | > |
20 | | - <TopicLinkBlockIcon v-if="topic.role && !change" :role="topic.role" /> |
| 20 | + <TopicLinkBlockIcon |
| 21 | + v-if="topic.role && !change" |
| 22 | + :role="topic.role" |
| 23 | + :imageOverride="references[iconOverride]" |
| 24 | + /> |
21 | 25 | <DecoratedTopicTitle v-if="topic.fragments" :tokens="topic.fragments" /> |
22 | 26 | <WordBreak v-else :tag="titleTag">{{ topic.title }}</WordBreak> |
23 | 27 | <span v-if="change" class="visuallyhidden">- {{ changeName }}</span> |
@@ -66,7 +70,8 @@ import WordBreak from 'docc-render/components/WordBreak.vue'; |
66 | 70 | import ContentNode from 'docc-render/components/DocumentationTopic/ContentNode.vue'; |
67 | 71 | import TopicLinkBlockIcon from 'docc-render/components/DocumentationTopic/TopicLinkBlockIcon.vue'; |
68 | 72 | import DecoratedTopicTitle from 'docc-render/components/DocumentationTopic/DecoratedTopicTitle.vue'; |
69 | | -import ConditionalConstraints from 'docc-render/components/DocumentationTopic/ConditionalConstraints.vue'; |
| 73 | +import ConditionalConstraints |
| 74 | + from 'docc-render/components/DocumentationTopic/ConditionalConstraints.vue'; |
70 | 75 | import RequirementMetadata |
71 | 76 |
|
72 | 77 | from 'docc-render/components/DocumentationTopic/Description/RequirementMetadata.vue'; |
@@ -98,7 +103,7 @@ export default { |
98 | 103 | RequirementMetadata, |
99 | 104 | ConditionalConstraints, |
100 | 105 | }, |
101 | | - inject: ['store'], |
| 106 | + inject: ['store', 'references'], |
102 | 107 | mixins: [getAPIChanges, APIChangesMultipleLines], |
103 | 108 | constants: { |
104 | 109 | ReferenceType, |
@@ -208,6 +213,10 @@ export default { |
208 | 213 | ), |
209 | 214 | // pick only the first available tag |
210 | 215 | tags: ({ topic }) => (topic.tags || []).slice(0, 1), |
| 216 | + iconOverride: ({ topic: { images = [] } }) => { |
| 217 | + const icon = images.find(({ type }) => type === 'icon'); |
| 218 | + return icon ? icon.identifier : null; |
| 219 | + }, |
211 | 220 | }, |
212 | 221 | }; |
213 | 222 | </script> |
|
0 commit comments