IlluminusLimited / Frontend

Pinster's Web UI
https://app-prod.pinster.io
GNU General Public License v3.0
3 stars 0 forks source link

Image component should account for thumbnailable images #63

Open stretch1414 opened 6 years ago

stretch1414 commented 6 years ago

My thoughts are that, on a thumbnailable image, we could always return a 100x100 image for quick loading, but then kick off a fetch to ImageService with passed in dimensions that would load after a time. React's state reloading makes this dead simple.

stretch1414 commented 6 years ago

This actually might be irrelevant because of #110

markmoser commented 6 years ago

What if we have two image components, Image and Thumbnail. Thumbnail will always produce smaller images, and handle the image stacking (for collection thumbs, etc) while Image is used for individual image viewing and handle the srcSet/sizes attributes.

It makes sense to me to split these in two.

stretch1414 commented 6 years ago

That makes sense to me as well. Would we have a wrapper component that decides which of the two we get? Or would they just pass the URL around if we needed to switch from a Thumbnail to an Image, and vice versa?

markmoser commented 6 years ago

I see Thumbnail and Image as simple components, and whatever is using them decides when to use which. So like the modal component requests the image for the view activations and thumbnails elsewhere.

The Thumbnail component should know when to show an image "Stack" and when to just show the primary photo.

stretch1414 commented 6 years ago

Oh okay, sounds good to me.

scytherswings commented 6 years ago

Yeah it's becoming more clear that a Thumbnail is distinct from a DisplayImage or Image or whatever. Sounds like a sensible change.