Page MenuHomePhabricator

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

Authored by atul on Aug 3 2023, 11:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 4:23 AM
Unknown Object (File)
Sat, Nov 9, 4:22 AM
Unknown Object (File)
Sat, Nov 9, 3:39 AM
Unknown Object (File)
Fri, Nov 1, 4:10 AM
Unknown Object (File)
Oct 2 2024, 7:16 AM
Unknown Object (File)
Oct 2 2024, 7:16 AM
Unknown Object (File)
Oct 2 2024, 7:13 AM
Unknown Object (File)
Oct 2 2024, 3:21 AM
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