Skip to content

Commit

Permalink
fix: added descending sort for commits on contributor section in sett…
Browse files Browse the repository at this point in the history
…ings page (#365)

* fix: bug fix to address issue #363

* fix: bug fix to address issue #363

* fix: bug fix to sort LONGHORN_SWE constant

* fix: fix to sort LONGHORN_SWE constant

Resolves #363
  • Loading branch information
Preston-Cook authored Oct 21, 2024
1 parent c2007ef commit a715bbd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/views/components/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,11 @@ export default function Settings(): JSX.Element {
<section className='my-8'>
<h2 className='mb-4 text-xl text-ut-black font-semibold'>UTRP CONTRIBUTERS</h2>
<div className='grid grid-cols-2 gap-4 2xl:grid-cols-4 md:grid-cols-3 xl:grid-cols-3'>
{LONGHORN_DEVELOPERS_SWE.map(swe => (
{LONGHORN_DEVELOPERS_SWE.sort(
(a, b) =>
(githubStats?.userGitHubStats[b.githubUsername]?.commits ?? 0) -
(githubStats?.userGitHubStats[a.githubUsername]?.commits ?? 0)
).map(swe => (
<div
key={swe.githubUsername}
className='border border-gray-300 rounded bg-ut-gray/10 p-4'
Expand Down Expand Up @@ -546,6 +550,11 @@ export default function Settings(): JSX.Element {
admin => admin.githubUsername === username
) && !LONGHORN_DEVELOPERS_SWE.some(swe => swe.githubUsername === username)
)
.sort(
(a, b) =>
(githubStats.userGitHubStats[b]?.commits ?? 0) -
(githubStats.userGitHubStats[a]?.commits ?? 0)
)
.map(username => (
<div
key={username}
Expand Down

0 comments on commit a715bbd

Please sign in to comment.