Author avatar prop can be an object #1719
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR modifies the Author component to allow the
avatar
property of anauthors
array item to be an object. If an object containing at least asrc
, it will be passed directly to the Avatar component. Otherwise, it will be passed as the Avatarsrc
as it was before.This will allow developers the option of preparing a more detailed
avatar
object including whatever properties Avatar supports, for examplesrcset
andsizes
.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
width
andheight
in addition to asrc
(other images should be the same as before)