dcgtc / dgrants

Decentralized Grant platform that implements quadratic funding.
GNU Affero General Public License v3.0
84 stars 39 forks source link

Improve how logo pointers are loaded #557

Closed apbendi closed 2 years ago

apbendi commented 2 years ago

Currently, the ptrToURI utility method is coupled to the applications placeholder image, and to our use of lazy loading images.

This method should be thought of as a utility method that might eventually exist in a separate dgrants library. As such, it should know nothing about the implementation details of the frontend.

In particular:

  1. The app should accept only a MetaPtr, not null or undefined. A component that uses this function is responsible for ensuring there is a MetaPtr object before calling this function, and should itself fallback to a placeholder rather than relying on this function to return one.
  2. The app should not return the placeholder if the protocol is not supported. Instead, it should return null, and the component consuming this function's return value should render the placeholder if it does not return a URI.