Page MenuHomePhabricator

[web] Add hook to generate placeholder image
ClosedPublic

Authored by bartek on May 21 2023, 7:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 12:41 PM
Unknown Object (File)
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
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
No Lint Coverage
Unit
No Test Coverage

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

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

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