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
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
Unknown Object (File)
Feb 10 2024, 10:45 PM
Unknown Object (File)
Jan 11 2024, 10:14 AM
Unknown Object (File)
Dec 16 2023, 4:17 AM
Unknown Object (File)
Dec 15 2023, 10:50 PM
Unknown Object (File)
Nov 22 2023, 4:12 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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/media/camera-modal.react.js
229–233 ↗(On Diff #27322)

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

508 ↗(On Diff #27322)

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 ↗(On Diff #27322)

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 ↗(On Diff #27322)

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 ↗(On Diff #27322)

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