-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves: #1340 On the Dependencies page, detail drawer, applications table: render the version text as a link to the maven central repository. The link uses the dependency's sha as the key in the maven central search. Add component `ExternalLink` to standardize rendering links outside of the app opening in a new tab. Signed-off-by: Scott J Dickerson <[email protected]>
- Loading branch information
Showing
5 changed files
with
133 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from "react"; | ||
import { Flex, FlexItem, Icon, Text } from "@patternfly/react-core"; | ||
import ExternalLinkAltIcon from "@patternfly/react-icons/dist/esm/icons/external-link-alt-icon"; | ||
|
||
/** | ||
* Render a link open an external href in another tab with appropriate styling. | ||
*/ | ||
export const ExternalLink: React.FC<{ | ||
href: string; | ||
children: React.ReactNode; | ||
}> = ({ href, children }) => ( | ||
<Flex spaceItems={{ default: "spaceItemsSm" }}> | ||
<FlexItem> | ||
<Text component="a" href={href} target="_blank"> | ||
{children} | ||
</Text> | ||
</FlexItem> | ||
<FlexItem> | ||
<Icon size="sm" status="info"> | ||
<ExternalLinkAltIcon /> | ||
</Icon> | ||
</FlexItem> | ||
</Flex> | ||
); | ||
|
||
export default ExternalLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters