Page MenuHomePhabricator

[native] Introduce new RegistrationUserAvatarCameraModal screen for registration flow
ClosedPublic

Authored by ashoat on May 31 2023, 1:11 PM.
Tags
None
Referenced Files
F1670242: D8044.diff
Sat, Apr 27, 3:29 PM
Unknown Object (File)
Thu, Apr 4, 9:10 PM
Unknown Object (File)
Thu, Apr 4, 9:10 PM
Unknown Object (File)
Thu, Apr 4, 9:09 PM
Unknown Object (File)
Thu, Apr 4, 9:01 PM
Unknown Object (File)
Feb 11 2024, 12:20 AM
Unknown Object (File)
Feb 11 2024, 12:19 AM
Unknown Object (File)
Feb 11 2024, 12:07 AM
Subscribers

Details

Summary

For photo avatar selection, our current pattern in the native app is to show another screen that handles this.

This diff continues that pattern, but introduces a new screen for the registration flow. Luckily we already have the scaffolding for this, as we needed separate screens for ThreadAvatarCameraModal and UserAvatarCameraModal already.

Depends on D8043

Test Plan

This was tested in combination with the rest of the stack. I tested:

  1. ENS flow, both when user has an ENS avatar and when they don't
  2. Setting an emoji avatar
  3. Setting an image avatar via camera
  4. Setting an image avatar via media library
  5. Tested avatar update flow after being logged in to make sure I didn't regress anything

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/media/camera-modal.react.js
229–233

Since it's not all AppNavigationProp anymore, I had to replace my fancy $ObjMapi with this union

508

This is used to lock / unlock orientation. CameraModal normally relocks orientation as soon as the dismissal starts, but in this case we'll wait until the component unrenders to relock orientation

If we want to improve this, I can try to look for a more generic ReactNav to check if the screen is active / dismissing

588

No need to animate opacity here for the registration flow, since it's being displayed in a stack instead of as an overlay / modal

860

goBackOnce is actually present in all navigators, since React Navigation includes action creators from parent navigators in child navigators

The only check that's actually necessary here is the overlayContext one, but Flow needs the check on goBackOnce

native/media/registration-user-avatar-camera-modal.react.js
16

This screen isn't actually used until D8047. I usually try to include callsites / usages in the same diff, but in this case I think it's more readable to separate it out

This revision is now accepted and ready to land.Jun 1 2023, 11:22 AM