Skip to content

Commit

Permalink
fixes_2
Browse files Browse the repository at this point in the history
  • Loading branch information
katerynashylina committed Aug 2, 2023
1 parent 82a6e29 commit 69f64fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Search: React.FC = () => {

return (
<div className="search">
<div className="search__content">
<label className="search__content">
<input
type="text"
placeholder={searchText}
Expand All @@ -66,7 +66,7 @@ export const Search: React.FC = () => {
<img src={search} alt="search" className="search__img" />
)}
</button>
</div>
</label>
</div>
);
};
5 changes: 3 additions & 2 deletions src/pages/PhonesPage/PhonesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getSortedAndFilteredPhones = (
sortOption: string,
currentPage: number,
itemsPerPage: string,
searchQuery: string
searchQuery: string,
) => {
let visiblePhones = [...phones];

Expand All @@ -33,6 +33,7 @@ const getSortedAndFilteredPhones = (

return phones.filter(phone => {
const phoneName = phone.name.toLowerCase();

return searchWords.every(word => phoneName.includes(word));
});
}
Expand Down Expand Up @@ -81,7 +82,7 @@ export const PhonesPage: React.FC<Props> = ({
sortOption,
currentPage,
itemsPerPage,
searchQuery
searchQuery,
);

return (
Expand Down

0 comments on commit 69f64fc

Please sign in to comment.