Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update profile list on character change #200

Merged
merged 10 commits into from
May 27, 2023
31 changes: 16 additions & 15 deletions src/components/Search/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function Search({ onSearch }) {

const handleInputChange = (event) => {
setSearchValue(event.target.value);
onSearch(event.target.value);
};

const handleSearch = () => {
Expand All @@ -34,21 +35,21 @@ function Search({ onSearch }) {
}, []);

return (
<div className="search-bar">
<input
ref={searchInput}
type="text"
onChange={handleInputChange}
value={searchValue}
placeholder="Search user by name, location or skills"
onKeyDown={handleSearchOnEnter}
/>
<FontAwesomeIcon
onClick={handleSearchButtonClick}
className="search-icon"
icon={faMagnifyingGlass}
/>
</div>
<div className="search-bar">
<input
ref={searchInput}
type="text"
onChange={handleInputChange}
value={searchValue}
placeholder="Search user by name, location or skills"
onKeyDown={handleSearchOnEnter}
/>
<FontAwesomeIcon
onClick={handleSearchButtonClick}
className="search-icon"
icon={faMagnifyingGlass}
/>
</div>
);
}

Expand Down