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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby-image): Add art direction #13395
feat(gatsby-image): Add art direction #13395
Changes from 1 commit
2d269f3
2ce14e0
c9f2f36
5d3ecb1
79d557c
cf3c58c
46dc731
6282c75
da6b873
fc12f62
03226cb
5317331
f283cad
e81b2b7
57363a5
a58da9b
a6d966d
6f5bb09
b685421
4ba3b86
c98c23d
5ceebb9
85c844a
d7b102a
55063e3
91478a2
9aa56b1
a0d0c78
c298cc6
9895126
6257cdf
836ce77
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the length check necessary? It'll likely fail iirc checking thebecause oflength
property if the prop itself is undefined? Or is thisconvertProps()
that it's safe to always assume an array value present?I would add that we have both
inImageCache()
andactivateCacheForImage()
both calling this method after first doing:We might as well just move that duplication into this method and drop the need to pass in props?
EDIT: I see that your
convertProps()
method returns an array regardless, so if it's empty a 0 falsey value for fluid will select fixed instead. My bad :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in the fixed section, there is code you've not handled which references
image
.divStyle
,bgColor
and theImg
tag(although I can't recall the impact of width/height attributes defined on an img element, have you confirmed variants with different width/height as fixed elements render correctly?Adjusting the width/height attributes on the fixed image in this demo doesn't appear to have any effect, so I guess it's just the other two that should be taken into consideration?
fluid
section also references the imagesaspectRatio
for thepaddingBottom
style. That's a case which may have gone missed?