Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for podcast image i n Picture.tsx #12568

Merged
merged 17 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading