Skip to content

Commit

Permalink
Merge pull request #182 from agiledev-students-fall2023/Search
Browse files Browse the repository at this point in the history
frontend fix
  • Loading branch information
Charlo-M authored Dec 6, 2023
2 parents 3523854 + 184e836 commit 34f557a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 42 deletions.
2 changes: 1 addition & 1 deletion front-end/src/pages/MainMap/MapLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const MapLayout = () => {
<div className="relative w-full my-1">
<input className={`w-full py-2 pl-10 pr-4 text-left border-solid border-2 border-navyBlue rounded-full placeholder:text-left placeholder:text-gray-400 bg-white`}
onInput={handleSubmit}
type="text" id="searchLocation" placeholder="Search for a city name"/>
type="text" id="searchLocation" placeholder="Title/Author"/>

<div className="absolute left-1 top-1">
{searchPage
Expand Down
41 changes: 0 additions & 41 deletions front-end/src/pages/MainMap/SearchMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@ const SearchMap = () => {
}, [searchData]);

console.log(suggestions);
const cities = [
'New York',
'San Francisco',
'Los Angeles',
'Chicago',
'Seattle',
'Miami',
'Beijing',
'Washington',
'Sydney',
'Charlotte'
];

const filteredCities = cities.filter(city => {
if (searchData) {
return city.toLowerCase().startsWith(searchData.toLowerCase());
}
return false;
}).slice(0, 4);

const handleCityClick = (evt, city) => {
evt.stopPropagation()
Expand All @@ -56,27 +37,5 @@ const SearchMap = () => {
setRefreshPopup(prev => prev+1)
};

return(
<>
<div className="px-[10%]">
<div className='overflow-scroll content-center'>
<ul>
{filteredCities.length ?
filteredCities?.map((suggestions, index) => (
<li className="border-b border-navyBlue" key={index} >
<div className="p-2 rounded-lg active:bg-white cursor-pointer">
{suggestions.location}
</div>
</li>
)) :
<li className="border-b border-navyBlue p-2 text-gray-400">
No Cities Found, Try "New York"
</li>
}
</ul>
</div>
</div>
</>
)
}
export default SearchMap

0 comments on commit 34f557a

Please sign in to comment.