diff --git a/packages/core-components/src/components/Link/Link.tsx b/packages/core-components/src/components/Link/Link.tsx index dd169390a5..89f5a69245 100644 --- a/packages/core-components/src/components/Link/Link.tsx +++ b/packages/core-components/src/components/Link/Link.tsx @@ -29,6 +29,7 @@ export const isExternalUri = (uri: string) => /^([a-z+.-]+):/.test(uri); export type LinkProps = MaterialLinkProps & RouterLinkProps & { component?: ElementType; + externalLinkTarget?: undefined | '_blank'; }; /** @@ -39,7 +40,14 @@ export const Link = React.forwardRef((props, ref) => { const to = String(props.to); return isExternalUri(to) ? ( // External links - + ) : ( // Interact with React Router for internal links diff --git a/plugins/explore/src/components/ToolCard/ToolCard.tsx b/plugins/explore/src/components/ToolCard/ToolCard.tsx index 00c9851865..584d0a54a6 100644 --- a/plugins/explore/src/components/ToolCard/ToolCard.tsx +++ b/plugins/explore/src/components/ToolCard/ToolCard.tsx @@ -18,7 +18,6 @@ import { ExploreTool } from '@backstage/plugin-explore-react'; import { BackstageTheme } from '@backstage/theme'; import { Box, - Button, Card, CardActions, CardContent, @@ -27,6 +26,7 @@ import { makeStyles, Typography, } from '@material-ui/core'; +import { Button } from '@backstage/core-components'; import classNames from 'classnames'; import React from 'react'; @@ -63,7 +63,6 @@ export const ToolCard = ({ card, objectFit }: Props) => { const classes = useStyles(); const { title, description, url, image, lifecycle, tags } = card; - const isExternalUrl = url.startsWith('https://') || url.startsWith('http://'); return ( @@ -99,9 +98,9 @@ export const ToolCard = ({ card, objectFit }: Props) => {