aragon / ui

🦚 UI kit for decentralized apps
https://ui.aragon.org/
MIT License
343 stars 127 forks source link

TokenAmount: Hold token space during image load #806

Closed andy-hook closed 4 years ago

andy-hook commented 4 years ago

I ran into a problem where expandable elements such as those on DataView and Accordion were measuring height dimensions incorrectly because TokenAmount wasn't mounted prior and hadn't loaded token images to render space.

A solution is to always provide the dimensions and a placeholder during load, this also stops content hopping around.

image

This does present the question of whether a placeholder being present when a fake token is used is acceptable. I think we should optimise for the common use case (a token address has an asset) and if we need to we can give the option to hide the token graphic via a flag in the future.