treejer/mobile

TreeJourney Context Refactor

Closed this issue · 1 comments

TreeJourney is inside the route.params on TreeSubmission navigation

The journey is better to be a Context instead of the params of navigation because now we don't reset the navigation to keep the in-progress journey
This is causing issues when the tree is going to update.

Files affecting this issue are:

  • TreeSubmission.tsx
  • SelectPlantType
  • SelectPhoto
  • SelectOnMap
  • MapMarking
  • SubmitTree (and submitTree)
  • TreeSubmissionStepper: remove all the props instead of "currentStep", all other props are the journey context
  • TreeDetails: set the tree journey based on the navigation params data

A simple sample for writing the new context is SettingsProvider context (take a look).

Hello dude. I'm on it, I will fix this problem.