Page MenuHomePhabricator

[web] Add hook to generate placeholder image
ClosedPublic

Authored by bartek on May 21 2023, 7:57 AM.
Tags
None
Referenced Files
F1653447: D7901.diff
Wed, Apr 24, 10:24 AM
Unknown Object (File)
Sun, Apr 14, 3:15 PM
Unknown Object (File)
Sun, Apr 14, 3:15 PM
Unknown Object (File)
Sun, Apr 14, 3:15 PM
Unknown Object (File)
Sun, Apr 14, 3:15 PM
Unknown Object (File)
Sun, Apr 14, 3:09 PM
Unknown Object (File)
Feb 23 2024, 9:03 PM
Unknown Object (File)
Feb 23 2024, 8:11 PM
Subscribers

Details

Summary

This diff adds a hool that generates placeholder data URL from given thumbhash string. It also decrypts the thumbhash if encryption key is provided.

The operation is synchronous for non-encrypted thumbhash and asynchronous for encrypted ones.

Depends on D7900

Test Plan

Tested together with the next diff.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.May 21 2023, 8:08 AM
ashoat added inline comments.
web/media/media-utils.js
3 ↗(On Diff #26728)

Nit – we mostly use React.useState and React.useEffect instead of importing these individually, but to be honest that convention probably doesn't really matter

217 ↗(On Diff #26728)

Not sure this comment is adding much value

This revision is now accepted and ready to land.May 22 2023, 9:42 AM

Use React imports, remove comment