Merge pull request #11533 from alexrybch/info-card-external-link

Fixed InfoCard with external link
This commit is contained in:
Patrik Oldsberg
2022-05-17 11:20:57 +02:00
committed by GitHub
3 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Fixed multiple scrolls appearing on Page when added InfoCard with external bottom link
@@ -15,6 +15,7 @@
*/
import { useAnalytics } from '@backstage/core-plugin-api';
import classnames from 'classnames';
import MaterialLink, {
LinkProps as MaterialLinkProps,
} from '@material-ui/core/Link';
@@ -36,6 +37,9 @@ const useStyles = makeStyles(
height: 1,
width: 1,
},
externalLink: {
position: 'relative',
},
},
{ name: 'Link' },
);
@@ -100,6 +104,7 @@ export const Link = React.forwardRef<any, LinkProps>(
onClick={handleClick}
{...(newWindow ? { target: '_blank', rel: 'noopener' } : {})}
{...props}
className={classnames(classes.externalLink, props.className)}
>
{props.children}
<span className={classes.visuallyHidden}>, Opens in a new window</span>
@@ -72,7 +72,7 @@ describe('Features', () => {
: The source control system where releases reside in a practical sense. Read more about
<a
class="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiTypography-colorPrimary"
class="MuiTypography-root MuiLink-root MuiLink-underlineHover Link-externalLink-12 MuiTypography-colorPrimary"
href="https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository"
rel="noopener"
target="_blank"