HomePhabricator
Diffusion Comm 4d3ff6bec4bb

[native] Update `useSelectFromGalleryAndUpdateUserAvatar` to return `isLoading`

Tags
None
Referenced Files
F496225: a73f31.png
Apr 19 2023, 12:28 PM
File Not Attached
F496223: 28224c.png
Apr 19 2023, 12:28 PM
File Not Attached
Subscribers
None

Description

[native] Update useSelectFromGalleryAndUpdateUserAvatar to return isLoading

Summary:
We modify useSelectFromGalleryAndUpdateUserAvatar to return a tuple of [selectFromGalleryAndUpdateUserAvatar, inProgress].

In the next diff we will consume the inProgress returned by useSelectFromGalleryAndUpdateUserAvatar to render a spinner over the image when processing or uploading or updating of avatar is in progress.

We could show some sort of upload progress as well, but I think just a spinner is fine for now.

For convenience, I'm going to have a multiple diffs where I update the EditUserAvatar flow, and then a single diff where I update the EditThreadAvatar flow to match. There's a lot of repetition, but I have ideas on how to consolidate things once we have a shippable experience.

Test Plan:
Consume inProgress in EditUserAvatar and log the value. The value being printed matched up with progress of the flow.

28224c.png (266×1 px, 50 KB)

a73f31.png (358×3 px, 103 KB)

Reviewers: ashoat, ginsu

Reviewed By: ashoat

Subscribers: tomek

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

Details