HomePhabricator
Diffusion Comm 8ce8efd3731d

[native] Introduce `openPhotoGallery` in `EditAvatar` component

Description

[native] Introduce openPhotoGallery in EditAvatar component

Summary:
This was largely copy/pasted from @ginsu's work here: https://gist.github.com/ginsueddy/8f0dc9f2033e1a3c61282a060527814f

For now this callback just opens the native OS image picker and constructs MediaLibrarySelection.

The MediaLibrarySelection will then be passed to processMedia (which conveniently takes NativeMediaSelection (which is an alias for MediaLibrarySelection | etc) and MediaProcessConfig.

Subsequent diffs will handle

  1. Processing the selected media
  2. Uploading the selected media
  3. Constructing avatar update request with server uploadID

Test Plan:
Replace onPress for "Use Emoji" button with openPhotoGallery to ensure that media gallery launches and selection is constructed correctly.

d71305.png (2×3 px, 3 MB)

Reviewers: ashoat, ginsu

Reviewed By: ashoat

Subscribers: tomek, ginsu

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

Details