on master help sign in
Merge pull request #1486 from urbit/mp/grant-nums-tweak
8035b45matildepark
pages/index.js+9−5
@@ -281,12 +281,16 @@ export async function getStaticProps() {
281 const grants = getAllPosts(["extra", "taxonomies"], "grants", "date");
281 const grants = getAllPosts(["extra", "taxonomies"], "grants", "date");
282
282
283 const grantNumbers = {
283 const grantNumbers = {
284+ starsAwarded: Math.floor(
284− starsAwarded: grants.reduce(
285+ grants.reduce(
285− (total, a) =>
286+ (total, a) =>
286− total + (Number(a?.extra?.reward.replace(/ star[s]?/, "")) || 0),
287+ total + (Number(a?.extra?.reward.replace(/ star[s]?/, "")) || 0),
287− 0
288+ 0
289+ )
288 ),
290 ),
291+ contributors: [
289− contributors: [...new Set(grants.map((e) => e.extra.assignee))].length,
292+ ...new Set(...[grants.map((e) => e.extra.assignee.split(","))]),
293+ ].length,
290 active: grants.filter(
294 active: grants.filter(
291 (e) =>
295 (e) =>
292 !e.extra.canceled &&
296 !e.extra.canceled &&