Skip to content
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(Image): improve handling of HTML props #2316

Merged
merged 4 commits into from
Nov 28, 2017
Merged

Conversation

layershifter
Copy link
Member

Related to #2079.

This PR improves handling of HTML props using our partitionHTMLInputProps function and adds examples.

@codecov-io
Copy link

codecov-io commented Nov 13, 2017

Codecov Report

Merging #2316 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2316   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files         152      152           
  Lines        2659     2659           
=======================================
  Hits         2652     2652           
  Misses          7        7
Impacted Files Coverage Δ
src/modules/Search/Search.js 99.46% <100%> (ø) ⬆️
src/modules/Checkbox/Checkbox.js 100% <100%> (ø) ⬆️
src/elements/Input/Input.js 100% <100%> (ø) ⬆️
src/elements/Image/Image.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f26f7cc...0616bb6. Read the comment docs.

@@ -73,6 +71,7 @@ function Image(props) {
className,
)
const rest = getUnhandledProps(Image, props)
const [imgTagProps, rootProps] = partitionHTMLInputProps(rest, { htmlProps: imageProps })
Copy link
Member

Choose a reason for hiding this comment

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

This seems strange to overload an input prop parser for an image. Should this become a generic parser?

Copy link
Member Author

@layershifter layershifter Nov 25, 2017

Choose a reason for hiding this comment

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

Agree, I will update PR and we will go with partitionHTMLProps.

@layershifter
Copy link
Member Author

partitionHTMLInputProps function was renamed to partitionHTMLProps . I will merge this as there was no another remarks.

@layershifter layershifter merged commit e42e031 into master Nov 28, 2017
@layershifter layershifter deleted the feat/image-props branch November 28, 2017 20:49
@levithomason
Copy link
Member

Released in semantic-ui-react@0.77.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants