-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
input working along the house filter
- Loading branch information
1 parent
b7f90df
commit ca13e91
Showing
5 changed files
with
51 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,39 @@ | ||
import '../../styles/layout/_cardsSearch.scss'; | ||
import PropTypes from 'prop-types'; | ||
|
||
function CharacterFilter() { | ||
function CharacterFilter({ searchInput, handleChangeCharacterFilter }) { | ||
|
||
//global variables | ||
|
||
|
||
|
||
//code when the page load | ||
|
||
|
||
//Search events and functions | ||
//handle the input change | ||
const handleInputChange = (ev) => { | ||
const newValue = ev.target.value; | ||
|
||
//trigger the search whenever the input changes | ||
handleChangeCharacterFilter(newValue); | ||
|
||
}; | ||
|
||
//HTML code | ||
return ( | ||
<> | ||
<section className="search__section"> | ||
<form className='form'> | ||
<div> | ||
<label className='form__label' | ||
>Busca por personaje: </label> | ||
<label className='form__label'>Busca por personaje: </label> | ||
<input className='form__input' | ||
type="text" name="search" id="search" /> | ||
type="text" | ||
name="search" id="search" | ||
value={searchInput} | ||
onChange={handleInputChange} /> | ||
</div> | ||
</form> | ||
</section> | ||
</> | ||
|
||
); | ||
} | ||
CharacterFilter.propTypes = { | ||
handleChangeCharacterFilter: PropTypes.func.isRequired, | ||
searchInput: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default CharacterFilter; |
This file contains 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
This file contains 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