Repository navigation
Fix "next task" nearby map not always zooming to encompass all nearby tasks and refactor nearby map component - #2986
Conversation
… properly zooms to them on open
|
This is good and works. Curious if you are interested in simplifying the component tho. There is some prop drilling going on and also some extra props that can be ripped out (For example excludeCurrentBundle). Things you should try to do:
This should leave you with one component with two props:
|
|
I can look into these, yes. I didn't initially in order to keep the diff small :) The main reason for it being pulled out into the parent component was because if we load the nearby tasks when the map opens, there is a brief period where the nearby tasks haven't loaded, and so we can't initialize the map zoomed to their bounds. I will look into alternative options to also clean up this component while maintaining the fixed behaviour! |
|
We could just use the challenge tasks and get the nearby tasks from there on the frontend. Could be an alternative to solve this issue. Feel free to experiment, or keep it as is! |
…emo, drop unused mapRef
The nearby task map wasn't always zooming to show all the nearby tasks as the nearby tasks were loaded when the next task window opens.
This PR fixes that, while also refactoring the nearby task map component to be more streamlined and use less prop-drilling.