Skip to content

Commit

Permalink
add contacts sort
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhafarovm committed Oct 15, 2021
1 parent 28bbacc commit 708444f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Components/Phonebook/ContactList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import ContactListItem from './ContactItem';
import css from './phonebook-css/ContactList.module.css';

export default function ContactList({ contacts }) {
contacts.sort((a, b) => a.name.localeCompare(b.name));

return (
<ul className={css.list}>
{contacts.map(({ id, name, phone }) => (
Expand Down

0 comments on commit 708444f

Please sign in to comment.