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

Add PlaceholderImage component #475

Closed
craigpalermo opened this issue Apr 12, 2019 · 5 comments
Closed

Add PlaceholderImage component #475

craigpalermo opened this issue Apr 12, 2019 · 5 comments

Comments

@craigpalermo
Copy link
Collaborator

Description

In order to create demos for image-related components in Storybook, we'd like to create a new component responsible for loading and rendering an image of a specified height and width. It would also be nice to support blurred images, for example, to demonstrate components that lazy-load images.

After reviewing a few possible placeholder image services, the following seem to satisfy our requirements:

Requirements

  • Randomly selects a service from the above list each time it loads an image
  • Accepts a boolean prop named blur
    • In this case, the component should retrieve its image from Lorem Picsum (the only service of the above that supports blur).
  • Accepts numeric height and width props to specify pixel dimensions of image
  • Should load a new image when any of the height, width, or blur props change (not on every component update)
@ael-mas
Copy link

ael-mas commented Apr 12, 2019

I'd like to work on this issue

@craigpalermo
Copy link
Collaborator Author

Thanks for volunteering @ael-mas! One thing I want to note before you get started is to try to avoid using any of the legacy lifecycle methods when updating the image, handling prop changes, etc.

@dansternfeld1
Copy link
Collaborator

Randomly selects a service from the above list each time it loads an image

Random should be the default, but you should be able to pick as well

Also, it'd be neat if it could export the image URL for use in existing components

@tfquirk
Copy link
Collaborator

tfquirk commented Aug 12, 2019

#554 Creates a PlaceholderImage component in packages/src.

@tfquirk
Copy link
Collaborator

tfquirk commented Sep 20, 2019

PR merged. Closing issue.

@tfquirk tfquirk closed this as completed Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants