Skip to content

Commit

Permalink
Fix up code to match updates; restrict total tally to last year
Browse files Browse the repository at this point in the history
  • Loading branch information
vladh committed Nov 13, 2024
1 parent 77e1e91 commit 20d4a0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/TotalTally.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// © 2024 Vlad-Stefan Harbuz <[email protected]>
// SPDX-License-Identifier: Apache-2.0
import LeaderboardMember from "./LeaderboardMember.astro";
import {
getGrandTotalRaised, fmtCurrency,
} from '../members.ts';
} from '../memberFormatting.ts';
---

<div class="total-tally">
<p>Our members have paid maintainers</p>
<h2>{fmtCurrency(await getGrandTotalRaised())}</h2>
<p>over the last year.</p>
</div>

<style>
Expand Down
4 changes: 1 addition & 3 deletions src/memberFormatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export async function getGrandTotalRaised() {
const members = filterInactiveMembers(await getMembers());
let grandTotal = 0;
members.forEach((member) => {
member.data.annualReports.forEach((report) => {
grandTotal += report.payments;
});
grandTotal += member.data.annualReports[0].usdAmountPaid;
});
return grandTotal;
}
Expand Down
4 changes: 1 addition & 3 deletions src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ const members = filterInactiveMembers(await getMembers());
<Blob kind="grad-dots-03" top="10%" left="-15rem"></Blob>

<main id="main-content">
<section>
<h1>About the Pledge</h1>
</section>
<h1>About the Pledge</h1>

<TableOfContents filepath={Astro.self.moduleId || ""} />

Expand Down
4 changes: 2 additions & 2 deletions src/pages/members/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import TotalTally from "../../components/TotalTally.astro";
<main id="main-content">
<section>
<div class="text-center">
<h1>Member Companies</h1>
<h1>Member<br>Companies</h1>
</div>
<TotalTally />
<Leaderboard grouped={false} />
<Leaderboard grouped={false}></Leaderboard>
</section>

<section class="flex-center bottom-cta">
Expand Down

0 comments on commit 20d4a0e

Please sign in to comment.