-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lib] Move
selectFromGalleryAndUpdateUserAvatar
from provider to `a…
…vatar-hooks` Summary: This diff involved moving `selectFromGalleryAndUpdateUserAvatar` from `Edit*AvatarProvider` to `avatar-hooks.react.js`... which makes a lot more sense. 1. As discussed D8316, this allows us to better decouple the avatar providers and hooks. The providers are an entity(user/thread)-specific, but platform-agnostic interface b/w client and `keyserver`, whereas avatar hooks are platform-specific implementations. The coupling between the providers and hooks made things difficult to work w/ when dealing with implementing image avatars on `web`. 2. Previously we had hooks which were "functions" of provider state which itself was a "function" of hooks. This diff starts to enforce the idea that hooks are "downstream" of providers which makes things easier to reason about. 3. `selectFromGallery` functionality is specific to `native` where we launch the image gallery programmatically and process the media selection. On `web`, we "virtually" click on an `<input>` to launch file selection, and then handle selected media from `onChange` callback... so things aren't as "sequential." 4. We're one step closer to merging `WebEditUserAvatarProvider` and `NativeEditUserAvatarProvider`. --- Depends on D8316 Test Plan: Still able to select and set image avatar from `native`. Reviewers: ashoat, ginsu, rohan Reviewed By: ginsu Subscribers: tomek Differential Revision: https://phab.comm.dev/D8318
- Loading branch information
1 parent
6746bd0
commit b309c50
Showing
5 changed files
with
31 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters