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:
@@ -501,7 +501,11 @@ export default function Settings(): JSX.Element {
|
|||||||
<section className='my-8'>
|
<section className='my-8'>
|
||||||
<h2 className='mb-4 text-xl text-ut-black font-semibold'>UTRP CONTRIBUTERS</h2>
|
<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'>
|
<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
|
<div
|
||||||
key={swe.githubUsername}
|
key={swe.githubUsername}
|
||||||
className='border border-gray-300 rounded bg-ut-gray/10 p-4'
|
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
|
admin => admin.githubUsername === username
|
||||||
) && !LONGHORN_DEVELOPERS_SWE.some(swe => swe.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 => (
|
.map(username => (
|
||||||
<div
|
<div
|
||||||
key={username}
|
key={username}
|
||||||
|
|||||||
Reference in New Issue
Block a user