Skip to content

Commit

Permalink
feat(project): add new cardImageAspectRatio custom param for playlists
Browse files Browse the repository at this point in the history
- deprecate `shelfImageAspectRatio` custom param
- add `cardImageAspectRatio` custom param
  • Loading branch information
AntonLantukh committed Jul 18, 2023
1 parent 6f993c6 commit 65264eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/CardGrid/CardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function CardGrid({
onCardHover,
}: CardGridProps) {
const breakpoint: Breakpoint = useBreakpoint();
const posterAspect = parseAspectRatio(playlist.aspectRatio || playlist.shelfImageAspectRatio);
const posterAspect = parseAspectRatio(playlist.cardImageAspectRatio || playlist.shelfImageAspectRatio);
const visibleTiles = cols[breakpoint] + parseTilesDelta(posterAspect);
const [rowCount, setRowCount] = useState(INITIAL_ROW_COUNT);

Expand Down
2 changes: 1 addition & 1 deletion src/containers/ShelfList/ShelfList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ShelfList = ({ rows }: Props) => {
<PlaylistContainer type={row.type} playlistId={row.contentId} key={`${row.contentId || row.type}_${index}`}>
{({ playlist, error, isLoading, style }) => {
const title = row?.title || playlist.title;
const posterAspect = parseAspectRatio(playlist.aspectRatio || playlist.shelfImageAspectRatio);
const posterAspect = parseAspectRatio(playlist.cardImageAspectRatio || playlist.shelfImageAspectRatio);
const visibleTilesDelta = parseTilesDelta(posterAspect);

return (
Expand Down

0 comments on commit 65264eb

Please sign in to comment.