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

Try: remove style variation badges from theme card #94512

Closed
wants to merge 1 commit into from
Closed
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
17 changes: 2 additions & 15 deletions packages/design-picker/src/components/theme-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Card, Popover } from '@automattic/components';
import clsx from 'clsx';
import { translate } from 'i18n-calypso';
import { forwardRef, useMemo, useRef, useState } from 'react';
import StyleVariationBadges from '../style-variation-badges';
import type { StyleVariation } from '../../types';
import type { Ref } from 'react';
import './style.scss';
Expand Down Expand Up @@ -63,16 +62,13 @@ const ThemeCard = forwardRef(
banner,
badge,
styleVariations = [],
selectedStyleVariation,
optionsMenu,
isActive,
isLoading,
isShowDescriptionOnImageHover,
isSoftLaunched,
onClick,
onImageClick,
onStyleVariationClick,
onStyleVariationMoreClick,
}: ThemeCardProps,
forwardedRef: Ref< any > // eslint-disable-line @typescript-eslint/no-explicit-any
) => {
Expand All @@ -88,6 +84,7 @@ const ThemeCard = forwardRef(
const themeInfoClasses = clsx( 'theme-card__info', {
'theme-card__info--has-style-variations': styleVariations.length > 0,
} );
const shouldDisplayBadge = ! isActive && ! optionsMenu;

return (
<Card
Expand Down Expand Up @@ -145,17 +142,7 @@ const ThemeCard = forwardRef(
<h2 className="theme-card__info-title">
<span>{ name }</span>
</h2>
{ ! optionsMenu && styleVariations.length > 0 && (
<div className="theme-card__info-style-variations">
<StyleVariationBadges
variations={ styleVariations }
selectedVariation={ selectedStyleVariation }
onMoreClick={ onStyleVariationMoreClick }
onClick={ onStyleVariationClick }
/>
</div>
) }
{ ! isActive && <>{ badge }</> }
{ shouldDisplayBadge && <div className="theme-card__info-tier-badge">{ badge }</div> }
{ optionsMenu && <div className="theme-card__info-options">{ optionsMenu }</div> }
{ isActive && <ActiveBadge /> }
</div>
Expand Down
10 changes: 1 addition & 9 deletions packages/design-picker/src/components/theme-card/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,11 @@ $theme-card-info-margin-top: 16px;
width: 0;
}

.theme-card__info-style-variations {
.theme-card__info-tier-badge {
align-items: center;
display: flex;
font-size: 0;
gap: 4px;
height: 24px;

.style-variation__badge-wrapper,
.style-variation__badge-more-wrapper {
&:focus-visible span {
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--color-primary-light);
}
}
}

.theme-card__info-options,
Expand Down
Loading