Skip to content

Commit eb616c6

Browse files
jenny-s51Titani
authored andcommitted
chore(Card): removed isHoverable prop (patternfly#8196)
* chore(card): remove isHoverable * update card snapshot
1 parent 302fd94 commit eb616c6

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ export interface CardProps extends React.HTMLProps<HTMLElement>, OUIAProps {
1212
className?: string;
1313
/** Sets the base component to render. defaults to article */
1414
component?: keyof JSX.IntrinsicElements;
15-
/** @deprecated to make a card hoverable, use isSelectable or isSelectableRaised. */
16-
isHoverable?: boolean;
1715
/** Modifies the card to include compact styling. Should not be used with isLarge. */
1816
isCompact?: boolean;
1917
/** Modifies the card to include selectable styling */
@@ -70,7 +68,6 @@ export const Card: React.FunctionComponent<CardProps> = ({
7068
id = '',
7169
className = '',
7270
component = 'article',
73-
isHoverable = false,
7471
isCompact = false,
7572
isSelectable = false,
7673
isSelectableRaised = false,
@@ -107,7 +104,7 @@ export const Card: React.FunctionComponent<CardProps> = ({
107104
if (isSelectableRaised) {
108105
return css(styles.modifiers.selectableRaised, isSelected && styles.modifiers.selectedRaised);
109106
}
110-
if (isSelectable || isHoverable) {
107+
if (isSelectable) {
111108
return css(styles.modifiers.selectable, isSelected && styles.modifiers.selected);
112109
}
113110
return '';

packages/react-core/src/components/Card/__tests__/Card.test.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ describe('Card', () => {
3737
expect(screen.getByText('im a div')).toBeInTheDocument();
3838
});
3939

40-
test('card with isHoverable applied ', () => {
41-
const { asFragment } = render(<Card isHoverable />);
42-
expect(asFragment()).toMatchSnapshot();
43-
});
44-
4540
test('card with isCompact applied ', () => {
4641
const { asFragment } = render(<Card isCompact />);
4742
expect(asFragment()).toMatchSnapshot();

packages/react-core/src/components/Card/__tests__/__snapshots__/Card.test.tsx.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ exports[`Card card with isCompact applied 1`] = `
44
<DocumentFragment>
55
<article
66
class="pf-c-card pf-m-compact"
7-
data-ouia-component-id="OUIA-Generated-Card-7"
8-
data-ouia-component-type="PF4/Card"
9-
data-ouia-safe="true"
10-
id=""
11-
/>
12-
</DocumentFragment>
13-
`;
14-
15-
exports[`Card card with isHoverable applied 1`] = `
16-
<DocumentFragment>
17-
<article
18-
class="pf-c-card pf-m-selectable"
197
data-ouia-component-id="OUIA-Generated-Card-6"
208
data-ouia-component-type="PF4/Card"
219
data-ouia-safe="true"

0 commit comments

Comments
 (0)