Skip to content

Commit e6768f6

Browse files
authored
Card pill with self hosted video main media (#15339)
* Let card footer render a pill for cards with a self hosted video as main media * Reuse WithSelfHostedVideoOnGallery main media object to prevent repetition
1 parent 5e16fd3 commit e6768f6

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

dotcom-rendering/src/components/Card/components/CardFooter.stories.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,58 @@ export const WithVideo = {
6868
},
6969
} satisfies Story;
7070

71+
export const WithSelfHostedVideoOnGallery = {
72+
...WithGallery,
73+
args: {
74+
...WithGallery.args,
75+
format: {
76+
display: ArticleDisplay.Standard,
77+
design: ArticleDesign.Gallery,
78+
theme: Pillar.Opinion,
79+
},
80+
mainMedia: {
81+
type: 'SelfHostedVideo',
82+
videoStyle: 'Loop',
83+
atomId: 'atom-id-123',
84+
sources: [
85+
{
86+
src: 'https://uploads.guim.co.uk/2026/01/09/Front_loop__Iran_TiF_Latest--64220ebf-d63d-48dd-9317-16b3b150a4ac-1.1.m3u8',
87+
mimeType: 'application/vnd.apple.mpegurl',
88+
},
89+
],
90+
height: 720,
91+
width: 576,
92+
duration: 18,
93+
},
94+
},
95+
} satisfies Story;
96+
97+
export const WithSelfHostedVideoOnAudio = {
98+
...WithAudio,
99+
args: {
100+
...WithAudio.args,
101+
format: {
102+
display: ArticleDisplay.Standard,
103+
design: ArticleDesign.Audio,
104+
theme: Pillar.Opinion,
105+
},
106+
mainMedia: WithSelfHostedVideoOnGallery.args.mainMedia,
107+
},
108+
} satisfies Story;
109+
110+
export const WithSelfHostedVideoOnVideo = {
111+
...WithVideo,
112+
args: {
113+
...WithVideo.args,
114+
format: {
115+
display: ArticleDisplay.Standard,
116+
design: ArticleDesign.Video,
117+
theme: Pillar.Opinion,
118+
},
119+
mainMedia: WithSelfHostedVideoOnGallery.args.mainMedia,
120+
},
121+
} satisfies Story;
122+
71123
export const WithNewsletter = {
72124
...WithAge,
73125
args: {

dotcom-rendering/src/components/Card/components/CardFooter.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const CardFooter = ({
8181
mainMedia?.type === 'YoutubeVideo' ||
8282
mainMedia?.type === 'Audio' ||
8383
mainMedia?.type === 'Gallery' ||
84+
mainMedia?.type === 'SelfHostedVideo' ||
8485
isNewsletter;
8586

8687
if (shouldShowPill) {

0 commit comments

Comments
 (0)