Skip to content

Commit

Permalink
Fix requests order based on thumbs up
Browse files Browse the repository at this point in the history
  • Loading branch information
junaid33 committed Feb 29, 2020
1 parent 988f892 commit d304232
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions content/alts/alts.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
"alts": [
{
"name": "Pixelfed",
"repo": "pixelfed / pixelfed",
"repo": "pixelfed/pixelfed",
"site": "https://pixelfed.org",
"stars": "2K",
"license": "AGPL V3",
Expand Down Expand Up @@ -625,4 +625,4 @@
"svg": "https://www.netlify.com/img/press/logos/full-logo-light.png"
}
]
}
}
5 changes: 4 additions & 1 deletion src/pages/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ export default () => {
.then(response => response.json()) // parse JSON from request
.then(resultData => {
console.log(resultData)
resultData.sort((a, b) =>
a.reactions.total_count < b.reactions.total_count ? 1 : -1
)
setRequests(resultData)
}) // set data for the number of stars
}, [])

return (
<>
<Box
Expand All @@ -51,7 +55,6 @@ export default () => {
Request open-source alternatives
</Text>
</Box>

</Box>
</Box>
</Box>
Expand Down

1 comment on commit d304232

@vercel
Copy link

@vercel vercel bot commented on d304232 Feb 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.