Context
This is a sub-issue of #53493 (Replace modal screens with modals from @react-navigation).
For full background and migration approach, see the triage analysis comment and the sub-issue breakdown comment.
Problem
AvatarCropModal animates in from right-to-left like a screen but uses react-native-modal, causing inconsistent animations. The migration is complex due to binary image data and Reanimated state.
Migration approach (Group 4 — Complex)
- File:
src/components/AvatarCropModal/AvatarCropModal.tsx (471 lines)
- Used by:
AvatarWithImagePicker.tsx (15+ screens) + AvatarPage.tsx
- Complexity:
- Binary image data (
File | CustomRNImageManipulatorResult) is not serializable to route params.
- Complex Reanimated state: pan, zoom, rotate gestures.
maskImage differs between usage sites.
Suggested migration approach
- When an image is picked, store the image URI (not the binary data) in a temporary Onyx key.
- The crop navigation page reads the image URI from Onyx, performs cropping/rotation via Reanimated, and writes the result URI back to a separate Onyx key.
- The parent component (
AvatarWithImagePicker) reads the result Onyx key reactively and triggers the upload API.
- Ensure each usage site cleans up the temporary Onyx keys after upload or cancellation.
- Test across all 15+ screens that use
AvatarWithImagePicker on iOS and Android.
Reference
Issue Owner
Current Issue Owner: @mallenexpensify
Context
This is a sub-issue of #53493 (Replace modal screens with modals from
@react-navigation).For full background and migration approach, see the triage analysis comment and the sub-issue breakdown comment.
Problem
AvatarCropModalanimates in from right-to-left like a screen but usesreact-native-modal, causing inconsistent animations. The migration is complex due to binary image data and Reanimated state.Migration approach (Group 4 — Complex)
src/components/AvatarCropModal/AvatarCropModal.tsx(471 lines)AvatarWithImagePicker.tsx(15+ screens) +AvatarPage.tsxFile | CustomRNImageManipulatorResult) is not serializable to route params.maskImagediffers between usage sites.Suggested migration approach
AvatarWithImagePicker) reads the result Onyx key reactively and triggers the upload API.AvatarWithImagePickeron iOS and Android.Reference
@react-navigation#53493 (comment)@react-navigation#53493Issue Owner
Current Issue Owner: @mallenexpensify