onfocus: send UpdateLocationSuggesion
UpdateLocationSuggesion
- if we already have geolocation: send UpdateLocationSuggesions
- if we don't: send GetLocation
UpdateLocationSuggesions
- if mobile and empty input and LocationSuccess: set state to suggesting location
- else: No update
GetLocation
- Prompt for user location
- Transform it on the server
- if success: send LocationSuccess
- if failure: send LocationError
LocationSuccess
- store success in state
- send: UpdateLocationSuggestions
LocationError
- store error in state
on "Near me" clik: send SelectLocationSuggestion
SelectLocationSuggestion
- side effect: build URL for geolocation and navigate
onfocus: Show menu render menu: show "Near me" (only on mobile for now)
on "Near me" click: send PromptGeolocation
PromptGeolocation:
- Prompt for user location
- Transform it on the server
- on success: Side Effect navigate to
points
url - on error: no No Update