HomePhabricator
Diffusion Comm efe9eb49757d

[native] Pull `useSelectAndUploadFromGallery` out of `Edit[User/Thread]Avatar`

Tags
None
Referenced Files
F494239: c40a6d.png
Apr 18 2023, 1:20 PM
File Not Attached
F494238: 1d60c3.png
Apr 18 2023, 1:20 PM
File Not Attached
Subscribers
None

Description

[native] Pull useSelectAndUploadFromGallery out of Edit[User/Thread]Avatar

Summary:
Pull out common functionality from Edit[User/Thread]Avatar and move to newly introduced avatar-hooks.js.

Added entry to editAvatarOptions in both components to consume this hook.


Depends on D7497

Test Plan:

  1. Click on pencil icon
  2. Ensure that the system media gallery appears as expected
  3. Ensure that the selection is processed as expected (logging + breakpoint)
  4. Ensure that selected image appears in keyserver uploads table:

1d60c3.png (1×3 px, 2 MB)

c40a6d.png (1×3 px, 1 MB)

Reviewers: ashoat, ginsu

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D7498

Details