Created
November 13, 2021 16:08
-
-
Save hieptl/74e555ae706d519b82f9796eb5bddc74 to your computer and use it in GitHub Desktop.
Search.js - Discord Clone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Search = (props) => { | |
const { onSearchChanged } = props; | |
const onChanged = (e) => { | |
const keywords = e.target.value.trim(); | |
onSearchChanged(keywords); | |
}; | |
return ( | |
<div className="add-friend__search"> | |
<span className="add-friend__search-title">Add Friend</span> | |
<p className="add-friend__search-sub-title">You can add a friend by searching their names!</p> | |
<input type="text" placeholder="Enter Username" onChange={onChanged} /> | |
</div> | |
); | |
}; | |
export default Search; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment