Skip to content

Rough Cardview scale support#2297

Merged
LFDanLu merged 5 commits into
cardview_followupfrom
cardview_scale_support
Sep 16, 2021
Merged

Rough Cardview scale support#2297
LFDanLu merged 5 commits into
cardview_followupfrom
cardview_scale_support

Conversation

@LFDanLu
Copy link
Copy Markdown
Member

@LFDanLu LFDanLu commented Sep 8, 2021

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@LFDanLu LFDanLu changed the base branch from main to cardview_followup September 8, 2021 00:41
@LFDanLu LFDanLu marked this pull request as draft September 8, 2021 00:41
if user only provides the layout constructor to CardView, we have to set itemPadding values for M/L scale for them after initializing the layout
@LFDanLu LFDanLu marked this pull request as ready for review September 14, 2021 18:59
@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

@LFDanLu LFDanLu changed the title (WIP) Cardview scale support Cardview scale support Sep 14, 2021
@LFDanLu LFDanLu changed the title Cardview scale support Rough Cardview scale support Sep 14, 2021
Comment on lines +47 to +53
if (typeof layout === 'function') {
if (layoutType === 'grid') {
cardViewLayout.itemPadding = scale === 'large' ? 116 : 95;
} else if (layoutType === 'gallery') {
cardViewLayout.itemPadding = scale === 'large' ? 143 : 114;
}
}
Copy link
Copy Markdown
Member Author

@LFDanLu LFDanLu Sep 14, 2021

Choose a reason for hiding this comment

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

If user passes a layout constructor to the CardView we have set the itemPadding for the user depending on the scale since the layout doesn't have a concept of scale. Perhaps the layout should have a scale option?

@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

@LFDanLu LFDanLu merged commit f097117 into cardview_followup Sep 16, 2021
@LFDanLu LFDanLu deleted the cardview_scale_support branch September 16, 2021 18:13
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.

2 participants