This hook composes together the previously created image avatar-related hooks (eg useProcessSelectedMedia, useUploadProcessedMedia, etc) to
- Display system image picker to user so they can pick image
- Processes the selected image
- Uploads the processed image
- Updates the user avatar with the uploadID of the uploaded processed image
There's still work to be done in terms of displaying status/progress, handling errors (eg cleaning up temporary files), etc... but this diff gets things working "end to end." Putting it up now to unblock @ginsu's camera work.
NOTE: Reusing this hook in EditThreadAvatar for now as a placeholder to satisfy Flow/ESLint/etc. Will introduce equivalent for threads in next diff.
NOTE: Renamed useSelectAndUploadFromGallery to useSelectFromGallery after "pulling out" useProcessSelectedMedia and useUploadProcessedMedia calls. Those are now handled in the higher level useSelectFromGalleryAndUpdateUserAvatar hook (and upcoming thread avatar equivalent).
Depends on D7509