Skip to content

Commit 125d8af

Browse files
committed
Updated to have a react node instead of a card title.
1 parent ab025fb commit 125d8af

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/react-core/src/components/Card/CardSubtitle.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@ import styles from '@patternfly/react-styles/css/components/Card/card';
44
export interface CardSubtitleProps {
55
/** Content rendered inside the description. */
66
children?: React.ReactNode;
7-
/** Additional classes added to the description. */
8-
className?: string;
97
/** Id of the description. */
108
id?: string;
119
}
1210

1311
export const CardSubtitle: React.FunctionComponent<CardSubtitleProps> = ({
1412
children = null,
15-
className = '',
1613
id = '',
1714
...props
1815
}: CardSubtitleProps) => (
19-
<div {...props} id={id} className={css(styles.cardSubtitle, className)}>
16+
<div {...props} id={id} className={css(styles.cardSubtitle)}>
2017
{children}
2118
</div>
2219
);

packages/react-core/src/components/Card/CardTitle.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ export const CardTitle: React.FunctionComponent<CardTitleProps> = ({
2525
const { cardId } = useContext(CardContext);
2626
const Component = component as any;
2727
const titleId = cardId ? `${cardId}-title` : '';
28+
const subtitleId = cardId ? `${cardId}-subtitle` : '';
2829

2930
return (
3031
<div className={css(styles.cardTitle)}>
3132
<Component className={css(styles.cardTitleText, className)} id={titleId || undefined} {...props}>
3233
{children}
3334
</Component>
34-
{subtitle && <CardSubtitle>{subtitle}</CardSubtitle>}
35+
{subtitle && <CardSubtitle id={subtitleId}>{subtitle}</CardSubtitle>}
3536
</div>
3637
);
3738
};

0 commit comments

Comments
 (0)