-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Update external links styling across the UI (#1602)
Resolves: https://issues.redhat.com/browse/MTA-1846 Update the render of external links to be consistent across the UI: - Use `ExternalLink` consistently - The icon used is the small size of `ExternalLinkAltIcon` - The text and the icon are both part of the link Use of `ExternalLink` updated to use the inline variant when used directly in table cells so it doesn't introduce extra height to the row. In a `td`, we want text and link content to be the same height. Use updated in: - Dependencies detail drawer, application table, version link - Issues table, expanded row, details links - Migration waves, status sub-table, issue link Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
- Loading branch information
Showing
4 changed files
with
25 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
import * as React from "react"; | ||
import { Flex, FlexItem, Icon, Text } from "@patternfly/react-core"; | ||
import { Button, Icon } 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; | ||
isInline?: boolean; | ||
children: React.ReactNode; | ||
}> = ({ href, children }) => ( | ||
<Flex spaceItems={{ default: "spaceItemsSm" }}> | ||
<FlexItem> | ||
<Text component="a" href={href} target="_blank"> | ||
{children} | ||
</Text> | ||
</FlexItem> | ||
<FlexItem> | ||
}> = ({ href, isInline = false, children }) => ( | ||
<Button | ||
variant="link" | ||
isInline={isInline} | ||
component="a" | ||
href={href} | ||
target="_blank" | ||
rel="noreferrer" | ||
icon={ | ||
<Icon size="sm" status="info"> | ||
<ExternalLinkAltIcon /> | ||
</Icon> | ||
</FlexItem> | ||
</Flex> | ||
} | ||
iconPosition="right" | ||
> | ||
{children} | ||
</Button> | ||
); | ||
|
||
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