Skip to content

Commit

Permalink
add condition for contactList
Browse files Browse the repository at this point in the history
  • Loading branch information
TkachenkoKaterina committed Mar 15, 2024
1 parent 94cdfc0 commit 7f1cc43
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/components/ContactList/ContactList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ const ContactList = () => {

return (
<div>
{filteredContacts && <h2 className={css.titleSecond}>Contacts</h2>}
<ul className={css.ul}>
{filteredContacts.map(contact => {
return (
<ContactItem
key={contact.id}
contact={contact}
onDeleteContact={handleDeleteContact}
/>
);
})}
</ul>
{filteredContacts && (
<>
<h2 className={css.titleSecond}>Contacts</h2>
<ul className={css.ul}>
{filteredContacts.map(contact => {
return (
<ContactItem
key={contact.id}
contact={contact}
onDeleteContact={handleDeleteContact}
/>
);
})}
</ul>
</>
)}
</div>
);
};
Expand Down

0 comments on commit 7f1cc43

Please sign in to comment.