Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Show pill in place of gallery icon
Browse files Browse the repository at this point in the history
jamesmockett committed Dec 12, 2024
1 parent 014a4c7 commit d6f48c2
Showing 1 changed file with 44 additions and 22 deletions.
66 changes: 44 additions & 22 deletions dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import {
palette as sourcePalette,
space,
} from '@guardian/source/foundations';
import { Hide, Link } from '@guardian/source/react-components';
import { Hide, Link, SvgCamera } from '@guardian/source/react-components';
import { ArticleDesign, type ArticleFormat } from '../../lib/articleFormat';
import { isMediaCard } from '../../lib/cardHelpers';
import { getZIndex } from '../../lib/getZIndex';
@@ -34,6 +34,7 @@ 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';
import { Snap } from '../Snap';
@@ -848,7 +849,8 @@ export const Card = ({
/>
) : null}
{!!mainMedia &&
mainMedia.type !== 'Video' && (
mainMedia.type !== 'Video' &&
mainMedia.type !== 'Gallery' && (
<MediaMeta
mediaType={mainMedia.type}
hasKicker={!!kickerText}
@@ -867,26 +869,46 @@ export const Card = ({
/>
)}

{!showCommentFooter && (
<CardFooter
format={format}
age={decideAge()}
commentCount={<CommentCount />}
cardBranding={
branding ? (
<CardBranding
branding={branding}
format={format}
onwardsSource={onwardsSource}
containerPalette={
containerPalette
}
/>
) : undefined
}
showLivePlayable={showLivePlayable}
/>
)}
{!showCommentFooter &&
mainMedia?.type === 'Gallery' && (
<div
css={css`
margin-top: auto;
`}
>
<Pill
prefix="Gallery"
content={(
galleryCount ?? 0
).toString()}
icon={<SvgCamera />}
iconSide="right"
/>
</div>
)}
{!showCommentFooter &&
mainMedia?.type !== 'Gallery' && (
<CardFooter
format={format}
age={decideAge()}
commentCount={<CommentCount />}
cardBranding={
branding ? (
<CardBranding
branding={branding}
format={format}
onwardsSource={
onwardsSource
}
containerPalette={
containerPalette
}
/>
) : undefined
}
showLivePlayable={showLivePlayable}
/>
)}
{showLivePlayable &&
liveUpdatesPosition === 'inner' && (
<Island

0 comments on commit d6f48c2

Please sign in to comment.