-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nearby View: Add Location Field Search #1320
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!!! Found some opportunities for cleanup, also looks like there might be a few type errors
@@ -286,6 +306,32 @@ function NearbyView({ | |||
> | |||
{/* This is used to scroll to top */} | |||
<div aria-hidden ref={firstItemRef} /> | |||
<LocationField |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're missing a currentPosition
prop here that's making it impossible to use current location
@@ -139,6 +149,12 @@ function NearbyView({ | |||
[nearbyViewCoords, currentPosition, map] | |||
) | |||
|
|||
const reverseCoords = (coords) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a useEffect
that checks if the currentPosition
coords are the same as finalNearbyCoords
and then runs reverseCoords
? Right now if I use current location, there's no feedback that my location was picked up correctly
...nearbyViewCoords, | ||
name: reversedPoint | ||
}} | ||
LocationIconComponent={() => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setReversedPoint(location.name || '') | ||
}} | ||
sortByDistance | ||
/> | ||
{loading && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds a location field search field to the nearby view. There are still some styling concerns, and the current location issue is annoying as well. Would be nice to get that fixed.
Should we have it try to render a string on first load? If we did that then the placeholder text would never appear and that's why I'm against it.
Should we add using this thing to the Percy tests?