Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: choose point on map for events #188

Merged
merged 20 commits into from
May 15, 2024
Merged

Conversation

GaelCondeLosada
Copy link
Collaborator

@GaelCondeLosada GaelCondeLosada commented May 13, 2024

What I did

  • Added a screen for the user to select a location on the map.
  • Added a button that redirect to this screen in EventCreationScreen

How I did it

  • Created the SelectLocationScreen and added it to navigation. The screen manages it's own point state internally (meaning the currently selected location is managed internally) but when navigating you can give a call back function for when the date change, the same way as a TextInput.
  • Used react-native-maps to implement the map.
  • Added a button in EventCreationScreen that redirects to this screen with the right callback function.
  • Modified tests to reflect changes.

How to verify it

Launch the application in expo go:

  • Go into EventCreationScreen
  • Create a new event and add a location (Note that there is a warning but it will be fixed in another PR also fixing the warnings in the other maps)
  • Try to click at multiples places (note that if you click on the name of a city for example the click does not register)
  • Try to confirmate the location
  • Go back to modify the location, see if it registered correctly
  • Save the event
  • You can go in the database and check if the location point is good

Demo video

WhatsApp.Video.2024-05-13.at.23.47.01_2a3ae089.mp4

Pre-merge checklist

The changes I have introduced:

  • work correctly
  • do not break other functionalities
  • work correctly on Android
  • are fully tested

@GaelCondeLosada GaelCondeLosada marked this pull request as ready for review May 13, 2024 21:51
@GaelCondeLosada GaelCondeLosada self-assigned this May 13, 2024
Copy link
Collaborator

@alexandre-mrt alexandre-mrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder to delete the log. Otherwise LGTM

Copy link

Copy link
Collaborator

@alexandre-mrt alexandre-mrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@AlbertoCentonze AlbertoCentonze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Gael, thanks for the PR! Can you help me understand why you passed navigation as a prop instead of using the hook as we were doing before?

Also I saw managed to pass functions through navigate which I couldn't do before, is it for this reason that you passed navigation as a prop?

@GaelCondeLosada GaelCondeLosada merged commit f298882 into main May 15, 2024
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API for the user to be able to choose a point on a map for his event
4 participants