diff --git a/src/components/NewUI/Event.tsx b/src/components/NewUI/Event.tsx index 766cd05..6a827e7 100644 --- a/src/components/NewUI/Event.tsx +++ b/src/components/NewUI/Event.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; +import PlacesAutocomplete from 'react-places-autocomplete'; const green = '#60f760'; const lightgrey = '#e0e0e0'; @@ -16,6 +17,8 @@ export default function Event({ }) { const [needRideThere, setNeedRideThere] = useState(false); const [needRideBack, setNeedRideBack] = useState(false); + const [rideThereLocation, setRideThereLocation] = useState(''); + const [rideBackLocation, setRideBackLocation] = useState(''); return (
{needRideThere && ( <> - + setRideThereLocation(address)} + value={rideThereLocation} + > + {({ + getInputProps, + getSuggestionItemProps, + suggestions, + loading, + }) => ( +
+ + {loading + ? 'Loading' + : suggestions.length > 0 && ( +
+ {suggestions.map((suggestion) => ( +
+ {suggestion.description} +
+ ))} +
+ )} +
+ )} +
- + setRideBackLocation(address)} + value={rideBackLocation} + > + {({ + getInputProps, + getSuggestionItemProps, + suggestions, + loading, + }) => ( +
+ + {loading + ? 'Loading' + : suggestions.length > 0 && ( +
+ {suggestions.map((suggestion) => ( +
+ {suggestion.description} +
+ ))} +
+ )} +
+ )} +