From 40d7696f246cde5918c78219fa729bef2ee6aaa1 Mon Sep 17 00:00:00 2001 From: Vlad-Stefan Harbuz Date: Tue, 8 Oct 2024 16:09:06 +0100 Subject: [PATCH] Leaderboard: add total tally proof of concept --- src/components/Leaderboard.astro | 67 ++++++++++++++++++-------------- src/members.ts | 12 ++++++ 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/components/Leaderboard.astro b/src/components/Leaderboard.astro index d7dadef..9693042 100644 --- a/src/components/Leaderboard.astro +++ b/src/components/Leaderboard.astro @@ -10,21 +10,47 @@ const { grouped } = Astro.props; import LeaderboardMember from "./LeaderboardMember.astro"; import { - getMembers, formatDevGroupBounds, filterInactiveMembers, groupMembers, + getMembers, getGrandTotalRaised, fmtCurrency, formatDevGroupBounds, filterInactiveMembers, groupMembers, sortMembersByDevs, DEV_GROUP_BOUNDS } from '../members.ts'; const members = filterInactiveMembers(await getMembers()); --- -{grouped ?
- {groupMembers(members).map((groupMembers, idx) => groupMembers.length > 0 &&
-

{formatDevGroupBounds(DEV_GROUP_BOUNDS[idx])}

+
+

Our members have raised a total of {fmtCurrency(await getGrandTotalRaised())}!

+ {grouped ?
+ {groupMembers(members).map((groupMembers, idx) => groupMembers.length > 0 &&
+

{formatDevGroupBounds(DEV_GROUP_BOUNDS[idx])}

+ + + + + + + + + + {sortMembersByDevs(groupMembers).map((member) => + + )} + +
Name + Devs + + $/dev +
+
)} +
: ( - - {sortMembersByDevs(groupMembers).map((member) => + {sortMembersByDevs(members).map((member) => )}
Name + Devs @@ -35,36 +61,19 @@ const members = filterInactiveMembers(await getMembers());
-
)} -
: ( - - - - - - - - - - {sortMembersByDevs(members).map((member) => - - )} - -
Name - Devs - - $/dev -
-)} + )} +