Skip to content

Conversation

@jonkafton
Copy link
Contributor

@jonkafton jonkafton commented Jun 27, 2024

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/4523

Description (What does it do?)

Displays media resource (podcast episodes, videos) images tn the homepage Media section carousel with square aspect ratios.

Screenshots (if appropriate):

image

How can this be tested?

Navigate to homepage. Check resource cards in the Media section have images with aspect ratio 1 and that their loading state reflects loaded proportions. Check that other resource cards are not affected.

Additional Context

  • Adds an isMedia prop to the LearningResourceCard.
  • Sets this on the Media section cards by carousel configuration

Opted to do this by configuration because although we can detect that a resource is media by its resource type (podcast, podcast_episode, video), if we do that at the card level we end up with these:

Screenshot 2024-06-27 at 17 45 41

}))
const MediaCarousel = styled(ResourceCarousel)(({ theme }) => ({
margin: "80px 0",
minHeight: "388px",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This preserves the height of the section as it was collapsing as I tabbed through the media types, though we may want to do this in the carousel itself.

@jonkafton jonkafton added the Needs Review An open Pull Request that is ready for review label Jun 27, 2024
@ChristopherChudzicki
Copy link
Contributor

@steven-hatch fyi ☝️

What was your expectation for media cards and course/program cards being mixed on the same carousel?

Jon's solution—make the square aspect ratio opt in, and only use it where we know all cards are media—seems reasonable.

@abeglova abeglova self-assigned this Jun 28, 2024
Copy link
Contributor

@abeglova abeglova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!

@jonkafton jonkafton merged commit 00895b9 into main Jun 28, 2024
This was referenced Jul 1, 2024
@rhysyngsun rhysyngsun deleted the jk/4523-podcast-cards branch February 7, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants