Merge pull request #16285 from awanlin/topic/use-link-for-linksgroup

Updated LinksGroup to use Link over ListItem
This commit is contained in:
Patrik Oldsberg
2023-02-14 10:12:33 +01:00
committed by GitHub
3 changed files with 11 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-org': patch
---
Updated `LinksGroup` to use `Link` over `ListItem` as this makes the links more obvious and follows the pattern already used in the `GroupProfileCard`. Also updated the `GroupProfileCard` `ExtraDetails` story in Storybook to enable the `showLinks` feature with this off there is no difference between it and the `default` story.
@@ -123,7 +123,7 @@ export const ExtraDetails = () => (
<EntityProvider entity={extraDetailsEntity}>
<Grid container spacing={4}>
<Grid item xs={12} md={4}>
<GroupProfileCard variant="gridItem" />
<GroupProfileCard variant="gridItem" showLinks />
</Grid>
</Grid>
</EntityProvider>
@@ -23,6 +23,7 @@ import {
Divider,
} from '@material-ui/core';
import React from 'react';
import { Link } from '@backstage/core-components';
const WebLink = ({
href,
@@ -33,9 +34,11 @@ const WebLink = ({
text?: string;
Icon?: IconComponent;
}) => (
<ListItem button component="a" key={href} href={href}>
<ListItem key={href}>
<ListItemIcon>{Icon ? <Icon /> : <LanguageIcon />}</ListItemIcon>
<ListItemText>{text}</ListItemText>
<ListItemText>
<Link to={href}>{text}</Link>
</ListItemText>
</ListItem>
);