diff --git a/src/components/LocationAutosuggest.jsx b/src/components/LocationAutosuggest.jsx index 6905ee2..8272f1b 100644 --- a/src/components/LocationAutosuggest.jsx +++ b/src/components/LocationAutosuggest.jsx @@ -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); @@ -48,7 +52,7 @@ const LocationAutosuggest = ({ selectedCity, onCityChange }) => { }, 850); }; - //Return Search input + //Return Search input return (
@@ -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 : "", diff --git a/src/components/LocationOptions.jsx b/src/components/LocationOptions.jsx index 032850a..28d61bf 100644 --- a/src/components/LocationOptions.jsx +++ b/src/components/LocationOptions.jsx @@ -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] }, @@ -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",