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

Adds preferredAspectRatio instances object support #12

Merged
merged 2 commits into from
Jul 15, 2019

Conversation

mattaho
Copy link
Contributor

@mattaho mattaho commented Jul 15, 2019

In order to properly support including a preferredAspectRatio object in the image prop, I did a bit of a refactor of this component. Primarily this was to separate the concerns a little bit more, using a more functional style with return values and getting rid of the imageProps var, as well as separating things out into a few more functions.

Some of the tests had to be revised a little bit because they weren't quite testing for the correct behavior, and I added another test for the aforementioned preferredAspectRatio object. As a note, in the data, preferredAspectRatio exists as a sibling to aspect_ratios, not as a child. This is what necessitated the re-work

@mattaho mattaho requested a review from kimthompson July 15, 2019 15:58
Copy link

@kimthompson kimthompson left a comment

Choose a reason for hiding this comment

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

Honestly, I don't have any questions. This is really neatly done!

@mattaho mattaho merged commit 2d96e3d into master Jul 15, 2019
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.

None yet

2 participants