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
[example] More expansive device detection and not load hidden imaged #38
Conversation
}} | ||
/> | ||
</span> | ||
) |
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.
All of this is to automatically size the container according to the actual aspect ratio. In cases the width and height are fixed this shouldn’t be necessary.
aspectRatio={1.261044176706827} | ||
src="https://d32dm0rphc51dk.cloudfront.net/JAo7pAN1p63YwolybeZgOg/small.jpg" | ||
style={{ width: "100px" }} | ||
/> |
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.
How does this translate to Reaction and other consumers? What will be required on the app side of things?
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.
This is the most extreme version imaginable, I don’t believe we have any place on Artsy where the size of the image isn’t constrained along at least one axis. The important part is using background-image
to display the image, as only when CSS is in control will the display
value have any effect on whether or not the image will be downloaded.
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.
I guess what I'm wondering is is there's anything we have to change in our codebase -- modify all images to use a background image rather than img src
or swap all call-sites to use a new component?
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.
Gotcha. Yeah I think we’d have an Image
component, that abstracts whatever we need away, and then do a img
-> Image
pass.
I'm going to merge this so I can start work to detect devices in Reaction. The discussion about the image loading should still continue, though! |
A little bit of this, a little bit of that.
Probably easiest to review per commit.