Skip to content

Commit f5d9dff

Browse files
authored
Merge pull request #13662 from guardian/doml/suppress-images
Hide podcast images when appropriate
2 parents 5412c72 + d83aa26 commit f5d9dff

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,12 @@ export const Card = ({
10641064
imageType={media?.type}
10651065
imageSize={imageSize}
10661066
isBetaContainer={isBetaContainer}
1067-
imagePositionOnDesktop={imagePositionOnDesktop}
1068-
imagePositionOnMobile={imagePositionOnMobile}
1067+
imagePositionOnDesktop={
1068+
image ? imagePositionOnDesktop : 'none'
1069+
}
1070+
imagePositionOnMobile={
1071+
image ? imagePositionOnMobile : 'none'
1072+
}
10691073
padContent={determinePadContent(
10701074
isMediaCardOrNewsletter,
10711075
isBetaContainer,

dotcom-rendering/src/components/FlexibleGeneral.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ export const StandardCardLayout = ({
436436
containerPalette,
437437
showAge,
438438
absoluteServerTimes,
439-
showImage = true,
440439
imageLoading,
441440
isFirstRow,
442441
isFirstStandardRow,
@@ -451,7 +450,6 @@ export const StandardCardLayout = ({
451450
containerPalette?: DCRContainerPalette;
452451
showAge?: boolean;
453452
absoluteServerTimes: boolean;
454-
showImage?: boolean;
455453
aspectRatio: AspectRatio;
456454
isLastRow: boolean;
457455
containerLevel: DCRContainerLevel;
@@ -485,7 +483,7 @@ export const StandardCardLayout = ({
485483
containerType="flexible/general"
486484
showAge={showAge}
487485
absoluteServerTimes={absoluteServerTimes}
488-
image={showImage ? card.image : undefined}
486+
image={card.image}
489487
imageLoading={imageLoading}
490488
imagePositionOnDesktop="left"
491489
supportingContent={card.supportingContent?.slice(

dotcom-rendering/src/model/enhanceCards.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ const decideMedia = (
197197
galleryCount: number = 0,
198198
audioDuration: string = '',
199199
podcastImage?: PodcastSeriesImage,
200+
imageHide?: boolean,
200201
): MainMedia | undefined => {
201202
// If the showVideo toggle is enabled in the fronts tool,
202203
// we should return the active mediaAtom regardless of the design
@@ -211,7 +212,7 @@ const decideMedia = (
211212
case ArticleDesign.Audio:
212213
return {
213214
type: 'Audio',
214-
podcastImage,
215+
podcastImage: !imageHide ? podcastImage : undefined,
215216
duration: audioDuration,
216217
};
217218

@@ -293,6 +294,7 @@ export const enhanceCards = (
293294
faciaCard.card.galleryCount,
294295
faciaCard.card.audioDuration,
295296
podcastImage,
297+
faciaCard.display.imageHide,
296298
);
297299

298300
return {

0 commit comments

Comments
 (0)