Skip to content

Commit

Permalink
Merge pull request #8 from iVladyuser/accounts
Browse files Browse the repository at this point in the history
update with filtration
  • Loading branch information
iVladyuser authored Dec 3, 2023
2 parents af7cc04 + e59e857 commit 1cf548a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/ContactList/ContactList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { SpinerDel } from 'components/Loader/Loader';

const ContactList = () => {
const dispatch = useDispatch();
const contacts = useSelector(contactsSelectors.selectContacts);
const visibleContacts = useSelector(contactsSelectors.selectFilteredContacts);
const isLoading = useSelector(contactsSelectors.selectContactsIsLoading);

useEffect(() => {
Expand All @@ -24,12 +24,13 @@ const ContactList = () => {
dispatch(contactsThunk.deleteContact(contactId));
};

const showContacts = Array.isArray(contacts) && contacts.length > 0;
const showContacts =
Array.isArray(visibleContacts) && visibleContacts.length > 0;

return (
<List>
{showContacts &&
contacts.map(({ id, name, number }) => {
visibleContacts.map(({ id, name, number }) => {
return (
<ContactItem key={id}>
<CardWrapper>
Expand Down

0 comments on commit 1cf548a

Please sign in to comment.