Merge pull request #4742 from SDA-SE/feat/multiple-supportlinks

Improve rendering of multiple support item links in the SupportButton
This commit is contained in:
Dominik Henneke
2021-03-03 17:01:05 +01:00
committed by GitHub
2 changed files with 13 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core': patch
---
Improve rendering of multiple support item links in the `SupportButton`
@@ -65,14 +65,14 @@ const SupportListItem = ({ item }: { item: SupportItem }) => {
</ListItemIcon>
<ListItemText
primary={item.title}
secondary={
<>
{item.links &&
item.links.map(link => (
<SupportLink link={link} key={link.url} />
))}
</>
}
secondary={item.links?.reduce<React.ReactNodeArray>(
(prev, link, idx) => [
...prev,
idx > 0 && <br key={idx} />,
<SupportLink link={link} key={link.url} />,
],
[],
)}
/>
</ListItem>
);