Page MenuHomePhabricator

[native] introduce user avatar camera modal
ClosedPublic

Authored by ginsu on Apr 25 2023, 1:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 5:42 AM
Unknown Object (File)
Sun, Nov 24, 5:42 AM
Unknown Object (File)
Sun, Nov 24, 5:42 AM
Unknown Object (File)
Sun, Nov 24, 5:42 AM
Unknown Object (File)
Sun, Nov 24, 5:41 AM
Unknown Object (File)
Sun, Nov 24, 5:41 AM
Unknown Object (File)
Wed, Nov 6, 4:20 PM
Unknown Object (File)
Sun, Nov 3, 7:50 PM
Subscribers

Details

Summary

Introduce user avatar camera modal

Depends on D7676

Test Plan

Difficult to provide a demo video, but 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. I also double checked that the loading state was in sync with the edit user avatar provider

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: ashoat, atul.
native/avatars/edit-user-avatar-provider.react.js
105–127 ↗(On Diff #25711)

shoot didn't realize how much copy + paste I was doing here. Will create another diff and put it in the stack before this diff and update this diff accordingly

ginsu published this revision for review.Apr 25 2023, 1:23 PM
ginsu planned changes to this revision.

Need to create a function to factor out code I commented above

ashoat requested changes to this revision.Apr 27 2023, 4:52 AM
ashoat added inline comments.
native/avatars/edit-user-avatar.react.js
50

Can we use UserAvatarCameraModalRouteName here instead of copy-pasting the string? And can you make sure you haven't done this anywhere else?

native/media/user-avatar-camera-modal.react.js
25–30

This useCallback is not necessary, and is only here because you typed BaseProps in CameraModal poorly.

You should be able to pass updateImageUserAvatar directly to CameraModal if you type handlePhotoCapture as (capture: PhotoCapture) => mixed. There's no reason that CameraModal needs to care about the return type there, so you should make the contract as "permissive" as possible, and let the function return anything it wants (mixed). That way it can return eg. a Promise without causing type errors.

This revision now requires changes to proceed.Apr 27 2023, 4:52 AM
native/avatars/edit-user-avatar.react.js
50

Did a global search and couldn't find any other instances of this

This revision is now accepted and ready to land.Apr 27 2023, 1:30 PM
This revision was automatically updated to reflect the committed changes.