fix: added descending sort for commits on contributor section in settings 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
This commit is contained in:
Preston Cook
2024-10-21 16:24:09 -05:00
committed by GitHub
parent c2007ef090
commit a715bbd933

View File

@@ -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'
@@ -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}