Page MenuHomePhabricator

[native] introduce naive user avatar camera modal
AbandonedPublic

Authored by ginsu on Apr 19 2023, 7:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 27 2024, 2:34 AM
Unknown Object (File)
Oct 1 2024, 9:05 PM
Unknown Object (File)
Oct 1 2024, 9:05 PM
Unknown Object (File)
Oct 1 2024, 9:05 PM
Unknown Object (File)
Oct 1 2024, 9:04 PM
Unknown Object (File)
Oct 1 2024, 8:59 PM
Unknown Object (File)
Sep 9 2024, 5:23 AM
Unknown Object (File)
Sep 7 2024, 9:35 PM
Subscribers

Details

Reviewers
ashoat
atul
Summary

Introduce user avatar camera modal. Will introduce thread avatar camera modal momentailry. Sorry that this diff is pretty large but hopefully Phab highlights all the copy/paste

Depends on D7548

Test Plan

I was able to use my camera to take a photo and the photo i snapped was set as my avatar after hitting "send" in the camera modal. Also tested going back, and when I hit the "X" button it just goes back to the profile screen

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/avatars/avatar-hooks.js
428 ↗(On Diff #25445)

To build useSelectFromCameraAndUpdateUserAvatar I copied and pasted the code from useSelectFromCameraAndUpdateUserAvatar. However, the big difference between the two is that instead of getting the selection from within the hook using something like selectFromGallery, we can instead just pass selection as a parameter when UserAvatarCameraModal uses this hook

570–574 ↗(On Diff #25445)

Tested what this looks like on Android, and got the following:

Screenshot 2023-04-19 at 10.00.10 PM.png (442×734 px, 31 KB)

ginsu retitled this revision from [native] introduce user avatar camera modal to [native] introduce naive user avatar camera modal.
ginsu edited the summary of this revision. (Show Details)
ginsu added reviewers: ashoat, atul.

update order of route name

ashoat requested changes to this revision.Apr 20 2023, 9:58 AM
ashoat added inline comments.
native/avatars/edit-user-avatar.react.js
42

I don't think this works. You have two separate invocations of useSelectFromCameraAndUpdateUserAvatar – one here, and one in UserAvatarCameraModal. Each of these invocations leads to distinct React state being created (processingOrUploadInProgress), and the two versions of this state are not synced

This revision now requires changes to proceed.Apr 20 2023, 9:58 AM
native/avatars/edit-user-avatar.react.js
42

Okay yea that makes sense, didn't realize that would be the case, but really good to know. So sounds like we need to introduce a context here to keep the state in sync

D7624 makes this diff obsolete