Skip to content

Commit

Permalink
Add support for podcast image i n Picture.tsx (#12568)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverabrahams authored Oct 24, 2024
1 parent 40168c4 commit 9fcf2ca
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dotcom-rendering/src/components/Picture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ import type { Loading } from './CardPicture';

export type Orientation = 'portrait' | 'landscape';

type PictureRoleType =
| RoleType
// Custom image role types that are used but do not come from CAPI / FE
| 'podcastCover';

type Props = {
role: RoleType;
role: PictureRoleType;
format: ArticleFormat;
master: string;
alt: string;
Expand Down Expand Up @@ -54,7 +59,7 @@ const decideImageWidths = ({
isLightbox,
orientation,
}: {
role: RoleType;
role: PictureRoleType;
isMainMedia?: boolean;
format: ArticleFormat;
isLightbox: boolean;
Expand Down Expand Up @@ -163,6 +168,11 @@ const decideImageWidths = ({
case 'supporting':
case 'halfWidth':
return [{ breakpoint: breakpoints.mobile, width: 445 }];
case 'podcastCover':
return [
{ breakpoint: breakpoints.mobile, width: 140 },
{ breakpoint: breakpoints.wide, width: 219 },
];
case 'inline':
default:
return [
Expand Down

0 comments on commit 9fcf2ca

Please sign in to comment.