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

chore(Card): removed isHoverable prop #8196

Merged
merged 2 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 1 addition & 4 deletions packages/react-core/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export interface CardProps extends React.HTMLProps<HTMLElement>, OUIAProps {
className?: string;
/** Sets the base component to render. defaults to article */
component?: keyof JSX.IntrinsicElements;
/** @deprecated to make a card hoverable, use isSelectable or isSelectableRaised. */
isHoverable?: boolean;
/** Modifies the card to include compact styling. Should not be used with isLarge. */
isCompact?: boolean;
/** Modifies the card to include selectable styling */
Expand Down Expand Up @@ -70,7 +68,6 @@ export const Card: React.FunctionComponent<CardProps> = ({
id = '',
className = '',
component = 'article',
isHoverable = false,
isCompact = false,
isSelectable = false,
isSelectableRaised = false,
Expand Down Expand Up @@ -107,7 +104,7 @@ export const Card: React.FunctionComponent<CardProps> = ({
if (isSelectableRaised) {
return css(styles.modifiers.selectableRaised, isSelected && styles.modifiers.selectedRaised);
}
if (isSelectable || isHoverable) {
if (isSelectable) {
return css(styles.modifiers.selectable, isSelected && styles.modifiers.selected);
}
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ describe('Card', () => {
expect(screen.getByText('im a div')).toBeInTheDocument();
});

test('card with isHoverable applied ', () => {
const { asFragment } = render(<Card isHoverable />);
expect(asFragment()).toMatchSnapshot();
});

test('card with isCompact applied ', () => {
const { asFragment } = render(<Card isCompact />);
expect(asFragment()).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ exports[`Card card with isCompact applied 1`] = `
<DocumentFragment>
<article
class="pf-c-card pf-m-compact"
data-ouia-component-id="OUIA-Generated-Card-7"
data-ouia-component-type="PF4/Card"
data-ouia-safe="true"
id=""
/>
</DocumentFragment>
`;

exports[`Card card with isHoverable applied 1`] = `
<DocumentFragment>
<article
class="pf-c-card pf-m-selectable"
data-ouia-component-id="OUIA-Generated-Card-6"
data-ouia-component-type="PF4/Card"
data-ouia-safe="true"
Expand Down