Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add second info ExternalLink field to the DetailsItem component #780

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const DetailsItem: React.FC<DetailsItemProps> = ({
helpContent,
moreInfoLabel,
moreInfoLink,
moreInfoLink2,
crumbs,
onEdit,
}) => {
Expand All @@ -41,6 +42,7 @@ export const DetailsItem: React.FC<DetailsItemProps> = ({
helpContent={helpContent}
moreInfoLabel={moreInfoLabel}
moreInfoLink={moreInfoLink}
moreInfoLink2={moreInfoLink2}
crumbs={crumbs}
/>
) : (
Expand All @@ -65,8 +67,16 @@ export const DescriptionTitleWithHelp: React.FC<{
helpContent: ReactNode;
moreInfoLabel?: string;
moreInfoLink?: string;
moreInfoLink2?: string;
crumbs?: string[];
}> = ({ title, helpContent, crumbs, moreInfoLabel = 'More info:', moreInfoLink }) => (
}> = ({
title,
helpContent,
crumbs,
moreInfoLabel = 'More info:',
moreInfoLink,
moreInfoLink2,
}) => (
<DescriptionListTermHelpText>
<Popover
headerContent={<div>{title}</div>}
Expand All @@ -80,6 +90,11 @@ export const DescriptionTitleWithHelp: React.FC<{
<ExternalLink href={moreInfoLink} isInline hideIcon>
<Truncate content={moreInfoLink} />
</ExternalLink>
{moreInfoLink2 && (
<ExternalLink href={moreInfoLink2} isInline hideIcon>
<Truncate content={moreInfoLink2} />
</ExternalLink>
)}
</FlexItem>
)}

Expand Down Expand Up @@ -153,6 +168,7 @@ export type DetailsItemProps = {
helpContent?: ReactNode;
moreInfoLabel?: string;
moreInfoLink?: string;
moreInfoLink2?: string;
crumbs?: string[];
onEdit?: () => void;
};