Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/LocationAutosuggest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const customStyles = {
}),
};

const sortedOptions = [...LOCATION_OPTIONS].sort((a, b) =>
a.value > b.value ? 1 : -1
);

//Set loading Icon - needs work -
const LocationAutosuggest = ({ selectedCity, onCityChange }) => {
const [isLoading, setIsLoading] = useState(false);
Expand All @@ -48,7 +52,7 @@ const LocationAutosuggest = ({ selectedCity, onCityChange }) => {
}, 850);
};

//Return Search input
//Return Search input
return (
<div style={{ display: "flex", justifyContent: "center" }}>
<div>
Expand All @@ -62,7 +66,7 @@ const LocationAutosuggest = ({ selectedCity, onCityChange }) => {
isClearable={false}
isSearchable={true}
name="location"
options={LOCATION_OPTIONS}
options={sortedOptions}
onChange={(selectedOption) => {
onCityChange(
selectedOption ? selectedOption.value : "",
Expand Down
8 changes: 5 additions & 3 deletions src/components/LocationOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export const LOCATION_OPTIONS = [
label: "San Francisco",
coordinates: [37.78, -122.412],
},
{ value: "Novi-Sad", label: "Novi Sad", coordinates: [45.2396, 19.8227] },
{ value: "Belgrade", label: "Belgrade", coordinates: [44.8125, 20.4612] },
{ value: "Zagreb", label: "Zagreb", coordinates: [45.815, 15.9819] },
{ value: "Sarajevo", label: "Sarajevo", coordinates: [43.8563, 18.4131] },
{ value: "Banja-Luka", label: "Banja-Luka", coordinates: [44.7722, 17.191] },
{ value: "Dublin", label: "Dublin", coordinates: [53.349805, -6.26031] },

{ value: "Berlin", label: "Berlin", coordinates: [52.520008, 13.404954] },
Expand Down Expand Up @@ -67,9 +72,6 @@ export const LOCATION_OPTIONS = [
{ value: "Derry", label: "Derry", coordinates: [54.997632, -7.308574] },
{ value: "Bray", label: "Bray", coordinates: [53.2009, -6.1114] },




{
value: "Waterford",
label: "Waterford",
Expand Down