Skip to content

Commit

Permalink
Only show pills in beta containers
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmockett committed Jan 8, 2025
1 parent 7df289e commit eb6f2f0
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { CardPicture } from '../CardPicture';
import { Island } from '../Island';
import { LatestLinks } from '../LatestLinks.importable';
import { MediaDuration } from '../MediaDuration';
import { MediaMeta } from '../MediaMeta';
import { Pill } from '../Pill';
import { Slideshow } from '../Slideshow';
import { SlideshowCarousel } from '../SlideshowCarousel.importable';
Expand Down Expand Up @@ -454,9 +455,14 @@ export const Card = ({
);
}

// Check media type to determine if we should show a pill or media icon
/**
* Check media type to determine if pill, or article metadata & icon shown.
* Currently pills are shown within beta containers.
*/
const showPill =
mainMedia?.type === 'Audio' || mainMedia?.type === 'Gallery';
isBetaContainer &&
mainMedia &&
(mainMedia.type === 'Audio' || mainMedia.type === 'Gallery');

const media = getMedia({
imageUrl: image?.src,
Expand Down Expand Up @@ -652,6 +658,12 @@ export const Card = ({
cardHasImage={!!image}
/>
) : null}
{!showPill && mainMedia && mainMedia.type !== 'Video' && (
<MediaMeta
mediaType={mainMedia.type}
hasKicker={!!kickerText}
/>
)}
</div>
)}

Expand Down Expand Up @@ -893,6 +905,14 @@ export const Card = ({
cardHasImage={!!image}
/>
) : null}
{!showPill &&
mainMedia &&
mainMedia.type !== 'Video' && (
<MediaMeta
mediaType={mainMedia.type}
hasKicker={!!kickerText}
/>
)}
</HeadlineWrapper>
)}

Expand Down

0 comments on commit eb6f2f0

Please sign in to comment.