From a715bbd933a87742e7bce3a44e8ba1bd419ad5eb Mon Sep 17 00:00:00 2001 From: Preston Cook Date: Mon, 21 Oct 2024 16:24:09 -0500 Subject: [PATCH] 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 --- src/views/components/settings/Settings.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/views/components/settings/Settings.tsx b/src/views/components/settings/Settings.tsx index 614f7714..34477e33 100644 --- a/src/views/components/settings/Settings.tsx +++ b/src/views/components/settings/Settings.tsx @@ -501,7 +501,11 @@ export default function Settings(): JSX.Element {

UTRP CONTRIBUTERS

- {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 => (
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 => (