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

Fallback image #66

Open
mxstbr opened this issue Jun 29, 2018 · 3 comments
Open

Fallback image #66

mxstbr opened this issue Jun 29, 2018 · 3 comments
Labels
question Further information is requested

Comments

@mxstbr
Copy link

mxstbr commented Jun 29, 2018

It'd be great if one could pass a fallback image to be used if loading the actual image fails. (this is useful for sites with user-uploaded photos that might not always be available) It could look something like:

<IdealImage
  src={user.profilePhoto}
  fallback="site.com/img/default-user-profile-photo.jpg"
/>
@stereobooster
Copy link
Owner

if loading the actual image fails

it will look like this

I'm trying to understand your use case. Let's assume there is fallback image, do you expect error icon over it and ability to retry on click?

@stereobooster stereobooster added the question Further information is requested label Jun 30, 2018
@mxstbr
Copy link
Author

mxstbr commented Jun 30, 2018

No, I wouldn't want the ability to retry—I would want to just show the default avatar.

@stereobooster
Copy link
Owner

stereobooster commented Jun 30, 2018

I would say this is a bit different component. It is possible to add this logic to the existing component, but it is already pretty big.

Initially I planed to implement small components, like lazy-load or adaptive-load and combine later in IdealImage, I didn't find a good way to compose them and gave up the idea. If such primitives would exist in this project it would be possible to construct what you want, but I do not want to overcomplicate existing component.

Other UX questions/ideas:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants