[Opinionated] Add alt attribute & remove container#13
Open
kurtextrem wants to merge 3 commits intonitish24p:masterfrom
Open
[Opinionated] Add alt attribute & remove container#13kurtextrem wants to merge 3 commits intonitish24p:masterfrom
kurtextrem wants to merge 3 commits intonitish24p:masterfrom
Conversation
nitish24p
requested changes
Feb 10, 2018
lib/ImageWorker.js
Outdated
| ); | ||
| const { style, imageClass, alt } = this.props; | ||
| const { isLoading, imgSrc } = this.state; | ||
| return state.isLoading ? this.renderPlaceholder() : |
Owner
There was a problem hiding this comment.
isLoading will be an unused variable.. you can change it to the following
return .isLoading ? this.renderPlaceholder() :
<img src={imgSrc}
style={{ ...style }} className={imageClass} alt={alt} />
Owner
|
So i converted it to a div because if someone supplies a placeholder as a display: inline-block |
manjula-dube
approved these changes
Feb 10, 2018
Collaborator
|
Looks Good @nitish24p I think we can merge it :) |
Owner
|
One comment, and eslint.. |
Owner
|
can you run npm run eslint to see the lint errors and fix those |
Contributor
Author
|
Fixed! But I think it should be added to the readme, because as I said I'd expect an |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I've added an alt attribute, because "Placeholder" and "Worker" as
altis not really nice.Second thing I've done is remove the container, because if you're using
<ImageWorker>as replacement for<img>it should not become a<div>.