Skip to content

Commit 7a8cbda

Browse files
committed
namespace card - add noSpan option to Tooltip
the span makes the title too big, and is not needed here
1 parent ec20f93 commit 7a8cbda

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/components/cards/namespace-card.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ export const NamespaceCard = ({ namespace, namespaceURL }: IProps) => {
7070
/>
7171
</CardHeaderMain>
7272
</CardHeader>
73-
<Tooltip content={title}>
73+
<Tooltip content={title} noSpan>
7474
<CardTitle>{getDescription(title, MAX_DESCRIPTION_LENGTH)}</CardTitle>
7575
</Tooltip>
7676
{title !== name ? (
77-
<Tooltip content={name}>
77+
<Tooltip content={name} noSpan>
7878
<CardBody>{getDescription(name, MAX_DESCRIPTION_LENGTH)}</CardBody>
7979
</Tooltip>
8080
) : null}

src/components/patternfly-wrappers/tooltip.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import React, { ReactNode } from 'react';
44
interface IProps {
55
children: ReactNode;
66
content: string | ReactNode;
7+
noSpan?: boolean;
78
position?: string | TooltipPosition;
89
}
910

10-
// wraps Tooltip to add a span wrap so that disabled elements still get tooltips
11-
export const Tooltip = ({ content, children, position }: IProps) => (
11+
// wraps Tooltip to add an optional span wrap so that disabled elements still get tooltips
12+
export const Tooltip = ({ content, children, noSpan, position }: IProps) => (
1213
<PFTooltip content={content} position={position as TooltipPosition}>
13-
<span>{children}</span>
14+
{noSpan ? <>{children}</> : <span>{children}</span>}
1415
</PFTooltip>
1516
);

0 commit comments

Comments
 (0)