Skip to content

Conversation

tylersticka
Copy link
Member

@tylersticka tylersticka commented Apr 7, 2022

Overview

This PR modifies the Author component to allow the avatar property of an authors array item to be an object. If an object containing at least a src, it will be passed directly to the Avatar component. Otherwise, it will be passed as the Avatar src as it was before.

This will allow developers the option of preparing a more detailed avatar object including whatever properties Avatar supports, for example srcset and sizes.

Note: I also considered creating a block for avatars, but since the author information is provided as an array, it seemed weird to have the avatars customizable only as a block and not as data. But I'm open to feedback on that!

Testing

  1. View the multiple authors story in Canvas view
  2. Check the HTML tab
  3. Confirm that the second image includes a width and height in addition to a src (other images should be the same as before)

@changeset-bot
Copy link

changeset-bot bot commented Apr 7, 2022

🦋 Changeset detected

Latest commit: 60354a5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudfour/patterns Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Apr 7, 2022

Deploy Preview for cloudfour-patterns ready!

Name Link
🔨 Latest commit 60354a5
🔍 Latest deploy log https://app.netlify.com/sites/cloudfour-patterns/deploys/624f5c419dd5910008616de7
😎 Deploy Preview https://deploy-preview-1719--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@tylersticka tylersticka marked this pull request as ready for review April 7, 2022 21:55
@tylersticka tylersticka requested a review from a team April 7, 2022 21:56
Copy link
Member

@spaceninja spaceninja left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for doing this!

@tylersticka tylersticka merged commit 8e7c631 into v-next Apr 7, 2022
@tylersticka tylersticka deleted the feature/more-author-avatar-props branch April 7, 2022 22:27
@github-actions github-actions bot mentioned this pull request Apr 7, 2022
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.

The Author component should accept width, height, sizes, and srcset
2 participants