-
- Downloads
Replace repetitive blurhash code with component (#14267)
This commit replaces all unnecessarily repeated code for decoding and embedding blurhash canvases with separate component - <Blurhash>. Under the hood Blurhash component will use effect dependent on its props. This gives a few benefits: it will only be re-rendered whenever the hash or width/height/dummy props update, and will not render if canvas won't get to the final DOM, because then effect won't fire, which prevents weird bugs like #14257.
Showing
- app/javascript/mastodon/components/blurhash.js 61 additions, 0 deletionsapp/javascript/mastodon/components/blurhash.js
- app/javascript/mastodon/components/media_gallery.js 13 additions, 33 deletionsapp/javascript/mastodon/components/media_gallery.js
- app/javascript/mastodon/features/account_gallery/components/media_item.js 9 additions, 31 deletions...astodon/features/account_gallery/components/media_item.js
- app/javascript/mastodon/features/status/components/card.js 10 additions, 32 deletionsapp/javascript/mastodon/features/status/components/card.js
- app/javascript/mastodon/features/video/index.js 9 additions, 29 deletionsapp/javascript/mastodon/features/video/index.js
Loading
Please register or sign in to comment