on master help sign in
index: round stars awarded, spread assignee prop
commita80e7c809b394fe090423ea4b296f23eee7b28fa authorMatilde Park <matilde.park@urbit.org> dateFri 6 May 2022, 18:09 (4 years ago) parentf9ee098
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 &&