Page MenuHomePhabricator

[web] Introduce `useUploadAvatarMedia` to `AvatarHooks`
ClosedPublic

Authored by atul on Aug 3 2023, 11:48 PM.
Tags
None
Referenced Files
F2773712: D8724.diff
Fri, Sep 20, 2:42 AM
Unknown Object (File)
Tue, Sep 10, 3:21 AM
Unknown Object (File)
Fri, Sep 6, 7:31 PM
Unknown Object (File)
Wed, Aug 28, 8:59 AM
Unknown Object (File)
Wed, Aug 28, 8:59 AM
Unknown Object (File)
Wed, Aug 28, 8:59 AM
Unknown Object (File)
Wed, Aug 28, 8:58 AM
Unknown Object (File)
Aug 9 2024, 5:46 PM
Subscribers

Details

Summary

This function is similar to useUploadProcessedMedia() in native/avatar-hooks. It basically lets us upload the File we receive from image input.

We consume useUploadAvatarMedia in EditUserAvatarMenu to upload the selected image. In subsequent diffs, we will update onImageSelected to handle the setting of the image avatar as well.

Test Plan
  1. Select "Select image" from EditUserAvatarMenu
  2. Select an image from the file explorer
  3. Check the uploads table and observe that the image was uploaded:

086e26.png (1×3 px, 773 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Aug 4 2023, 12:54 AM
atul added inline comments.
web/avatars/edit-user-avatar-menu.react.js
72–73 ↗(On Diff #29524)

Error handling and whatnot will be handled later in the stack

This revision is now accepted and ready to land.Aug 4 2023, 6:40 AM