-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix Background and fit property fixes #268 #270
Conversation
Hey @verbeeksteven, thanks for pointing this out and opening a PR. As you pointed out it looks like we are unintentionally hardcoding the fit parameter to |
@sherwinski Yup! I wasn't sure if there was something else you wanted done. You are more then welcome to adjust/do what ever you want with my PR :) |
Any update @sherwinski I can make adjustments if you want. |
Hi @verbeeksteven thanks for following up and sorry for the hold up, the last week has been a bit busy. |
@@ -88,7 +88,7 @@ const BackgroundImpl = props => { | |||
...(disableLibraryParam ? {} : { ixlib: `react-${PACKAGE_VERSION}` }), | |||
width, | |||
height, | |||
fit: "crop", | |||
fit: (imgixParams.fit) ? imgixParams.fit : "crop", |
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.
If I could suggest tweaking things here for cleanliness:
const renderedSrc = (() => {
const srcOptions = {
fit: "crop",
...imgixParams,
...(disableLibraryParam ? {} : { ixlib: `react-${PACKAGE_VERSION}` }),
width,
height,
dpr
};
return constructUrl(src, srcOptions);
})();
Hey @verbeeksteven sorry for the silence on this PR but don't worry, I did not forget about you! I am going to fix this issue as part of a separate PR, mostly to sidestep issues with prettier but also to add tests and whatnot. I'd love to add you as a reviewer if you'd like to take a look at the end result. Feel free to comment back with any questions. |
I haven't had a ton of time to do it either, I will certain test out any edits you do though! |
Fixes #268