Skip to content

Conversation

davidornelas11
Copy link
Contributor

This adds the options for rendering multiple cards for the ranking cards and Card component in unity-react-core. Webspark will have to be updated to use this but the default/old behavior is still there and users will have to intentinally use the new prop to use the new render feature

Description

Checklist

  • Tests pass for relevant code changes

Important Reminders

Links

@davidornelas11 davidornelas11 requested a review from a team as a code owner September 8, 2025 22:43
@asu-jenkins-devops
Copy link
Collaborator

Copy link
Member

@mlsamuelson mlsamuelson left a comment

Choose a reason for hiding this comment

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

@davidornelas11 I like this approach, it moves us forward without introducing a breaking change. Nice. Appears it will be adaptive for use with multiple column types based on where it's placed.

Only concern at this point is problematic rendering when images have different heights: https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1577/@asu/unity-react-core/index.html?path=/story/components-image--three-images-arrangement

Screenshot 2025-09-12 at 2 24 53 PM

@davidornelas11
Copy link
Contributor Author

Per brand team, a 4:3 aspect ratio will be enforced with the styles when the card-arrangement is used. No changes to previous behavior. Webspark already crops and takes care of this so will only affect nonwebspark users

/**
* Array of card objects for rendering multiple cards
*/
cards: PropTypes.arrayOf(
Copy link
Contributor

Choose a reason for hiding this comment

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

Cards has same structure as BaseCard, might need to rearrange the file, but can we reuse the prop structure

cards: PropTypes.arrayOf(PropTypes.shape(BaseCard.propTypes))

showBorders = true,
cardLink,
cards = [],
columns = "0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are moving towards responsive design, and we should not allow columns to be a property. Columns should be responsive and allow the card to adjust between the min and max widths provided by the brand team.

tags,
showBorders = true,
cardLink,
cards = [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Card feels like it is doing too much. Should we have a card-arrangement component that takes an array of 1 or more cards?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am ok with this temporarily if we have to keep it for WS2 purposes, but think it will cause issue down the line since it is a strange pattern

cardLink,
cards = [],
columns = "0",
layout = "auto"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does auto mean horizontal?
Instead of layout default to auto can we change layout prop to vertical = true or forceVertical = true?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see we already have horizontal prop. these props are getting confusing

@davidornelas11 davidornelas11 marked this pull request as draft October 21, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants