on master help sign in
Merge pull request #1486 from urbit/mp/grant-nums-tweak

index: round stars awarded, spread assignee prop

commit8035b451144aa56f35e0d24404b8f8592d68b650 authormatildepark <matilde.park@urbit.org> dateFri 6 May 2022, 18:20 (4 years ago) parentf9ee098a80e7c8
1 file changed+9−5
pages/index.js+9−5
pages/index.js+9−5
@@ -281,12 +281,16 @@ export async function getStaticProps() {
281281 const grants = getAllPosts(["extra", "taxonomies"], "grants", "date");
282282
283283 const grantNumbers = {
284− starsAwarded: grants.reduce(
285− (total, a) =>
286− total + (Number(a?.extra?.reward.replace(/ star[s]?/, "")) || 0),
287− 0
284+ starsAwarded: Math.floor(
285+ grants.reduce(
286+ (total, a) =>
287+ total + (Number(a?.extra?.reward.replace(/ star[s]?/, "")) || 0),
288+ 0
289+ )
288290 ),
289− contributors: [...new Set(grants.map((e) => e.extra.assignee))].length,
291+ contributors: [
292+ ...new Set(...[grants.map((e) => e.extra.assignee.split(","))]),
293+ ].length,
290294 active: grants.filter(
291295 (e) =>
292296 !e.extra.canceled &&