From df1dd83b2f565235b0526bebd1d6486154f7e320 Mon Sep 17 00:00:00 2001 From: Dominik Lander Date: Wed, 22 Jan 2025 10:26:19 +0000 Subject: [PATCH] Add podcast image and footer pill in audio feature cards --- .../components/Card/components/CardFooter.tsx | 14 + .../src/components/FeatureCard.stories.tsx | 13 + .../src/components/FeatureCard.tsx | 256 +++++++++++------- .../ScrollableFeature.importable.tsx | 2 + dotcom-rendering/src/lib/getZIndex.ts | 1 + 5 files changed, 182 insertions(+), 104 deletions(-) diff --git a/dotcom-rendering/src/components/Card/components/CardFooter.tsx b/dotcom-rendering/src/components/Card/components/CardFooter.tsx index 93fd440b5dd..9f82d419a04 100644 --- a/dotcom-rendering/src/components/Card/components/CardFooter.tsx +++ b/dotcom-rendering/src/components/Card/components/CardFooter.tsx @@ -2,6 +2,7 @@ import { css } from '@emotion/react'; import { palette, space, textSansBold12 } from '@guardian/source/foundations'; import { SvgCamera } from '@guardian/source/react-components'; import { Pill } from '../../../components/Pill'; +import { SvgMediaControlsPlay } from '../../../components/SvgMediaControlsPlay'; import { type ArticleFormat, ArticleSpecial } from '../../../lib/articleFormat'; import type { MainMedia } from '../../../types/mainMedia'; @@ -46,6 +47,7 @@ type Props = { cardBranding?: JSX.Element; mediaType?: MainMedia['type']; galleryCount?: number; + audioDuration?: string; }; export const CardFooter = ({ @@ -56,6 +58,7 @@ export const CardFooter = ({ showLivePlayable, mediaType, galleryCount, + audioDuration, }: Props) => { if (showLivePlayable) return null; @@ -63,6 +66,17 @@ export const CardFooter = ({ return ; } + if (mediaType === 'Audio' && audioDuration !== undefined) { + return ( + + ); + } + if (mediaType === 'Gallery') { return (