Skip to content

Commit 6e1f81d

Browse files
committed
Sort contributors alphabetically
1 parent f650a90 commit 6e1f81d

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

src/components/Contributors.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ const ContributorCard = styled(ActionCard)`
3434
const Contributors = () => {
3535
return (
3636
<Container>
37-
{data.contributors.map((contributor, idx) => {
38-
return (
39-
<ContributorCard
40-
key={idx}
41-
image={contributor.avatar_url}
42-
to={contributor.profile}
43-
title={contributor.name}
44-
/>
45-
)
46-
})}
37+
{data.contributors
38+
.sort((a, b) => a.name.localeCompare(b.name))
39+
.map((contributor, idx) => {
40+
return (
41+
<ContributorCard
42+
key={idx}
43+
image={contributor.avatar_url}
44+
to={contributor.profile}
45+
title={contributor.name}
46+
/>
47+
)
48+
})}
4749
</Container>
4850
)
4951
}

0 commit comments

Comments
 (0)