Skip to content

[Odometer] DRY shared camera logic between IOURequestStepScan and Odometer image capture #83356

@Julesssss

Description

@Julesssss

Parent issue: #71841

Follow up improvement issue from #82432


The Odometer image capture flow (IOURequestStepDistanceOdometerScan) duplicates significant logic from src/pages/iou/request/step/IOURequestStepScan/index.native.tsx. Extract shared functions/hooks/components to be reused in both places.

Improvements include: (some were already applied to PR updates)

  • Remove useEffect watching focusPoint - call focusCamera directly from tap
    gesture handler
  • Missing return after showCameraAlert() when camera.current
  • tapGesture / capturePhoto duplication
  • Child components
  • CONSISTENCY-6: Missing .catch() on cropImageToAspectRatio().then()
  • CONSISTENCY-5: eslint-disable at line 408 lacks justification comment
  • P1 (Codex): Hardcoded shouldUseTransactionDraft(CONST.IOU.ACTION.CREATE,
    CONST.IOU.TYPE.REQUEST)
  • Magic number style values should use named constants

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions