PoiPoi-Dev / PoiPoi-frontend

MIT License
1 stars 4 forks source link

Refactor/use closest pin #42

Closed J-Ariola closed 2 months ago

J-Ariola commented 2 months ago

Description

Refactored the component layout of SubmitGuessButton and Poidex into GameControls component. This is to separate the game UI controls from the map UI controls and pass relevent data. Using geolocation.watch position has been refactored into a custom hook userGeolocation. Using this custom hook, the program now can find the user location and closest pin. This data is passed into the GameControls component to be handled. The performance of SubmitGuessButton has improved significantly.

Card Link

https://3.basecamp.com/5802516/buckets/37608217/card_tables/cards/7483153700

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Tested manually. Functions work exactly as the same before.

There seems to be an error related in getting geoposition, but it might be related to using browser geolocation spoofing and now related to mobile device use.

Checklist before requesting a review