on master help sign in
pages, lib, components: update grants to work with arrays
1a2a14aMatilde Park
components/GrantPreview.js+1−1
@@ -3,7 +3,7 @@ import Link from "next/link";
3
3
4export default function GrantPreview({ grant }) {
4export default function GrantPreview({ grant }) {
5 const isCompleted = grant.extra.completed;
5 const isCompleted = grant.extra.completed;
6− const isOpen = !isCompleted && grant.extra.assignee === "";
6+ const isOpen = !isCompleted && grant.extra.assignee?.[0] === "";
7 const type = grant.taxonomies.grant_type;
7 const type = grant.taxonomies.grant_type;
8
8
9 const className = classnames({
9 const className = classnames({
lib/lib.js+1−1
@@ -279,7 +279,7 @@ export function getOpenGrantsCount() {
279 if (
279 if (
280 !metadata.data.extra.completed &&
280 !metadata.data.extra.completed &&
281 !metadata.data.extra.canceled &&
281 !metadata.data.extra.canceled &&
282− metadata.data.extra.assignee === ""
282+ metadata.data.extra.assignee?.[0] === ""
283 ) {
283 ) {
284 return acc + 1;
284 return acc + 1;
285 }
285 }
pages/grants.js+1−1
@@ -69,7 +69,7 @@ export default function Grants({ posts, categories, types, search }) {
69 return { ...post, status: "canceled" };
69 return { ...post, status: "canceled" };
70 } else if (post.extra.completed) {
70 } else if (post.extra.completed) {
71 return { ...post, status: "completed" };
71 return { ...post, status: "completed" };
72− } else if (post.extra.assignee && post.extra.assignee.length > 0) {
72+ } else if (post.extra.assignee && post.extra.assignee?.[0].length > 0) {
73 return { ...post, status: "wip" };
73 return { ...post, status: "wip" };
74 } else {
74 } else {
75 return { ...post, status: "open" };
75 return { ...post, status: "open" };
pages/grants/[slug].js+17−8
@@ -27,13 +27,22 @@ export default function Grant({ post, markdown, search }) {
27 const assignee = post?.extra?.assignee;
27 const assignee = post?.extra?.assignee;
28 const mentor = post.extra.mentor || post.extra.champion;
28 const mentor = post.extra.mentor || post.extra.champion;
29 const assigneeLink =
29 const assigneeLink =
30+ assignee &&
31+ assignee.map((each, index) => {
30− assignee && ob.isValidPatp(assignee) ? (
32+ return ob.isValidPatp(each) ? (
33+ <>
34+ {index ? ", " : ""}
31− <Link href={`/ids/${assignee}`} passHref>
35+ <Link href={`/ids/${each}`} passHref>
32− <a className="text-green-400">{assignee}</a>
36+ <a className="text-green-400">{each}</a>
33− </Link>
37+ </Link>
38+ </>
34− ) : (
39+ ) : (
35− assignee
40+ <>
41+ {index ? ", " : ""}
42+ {each}
43+ </>
44+ );
36− );
45+ });
37 const mentorLink =
46 const mentorLink =
38 mentor && ob.isValidPatp(mentor) ? (
47 mentor && ob.isValidPatp(mentor) ? (
39 <Link href={`/ids/${mentor}`} passHref>
48 <Link href={`/ids/${mentor}`} passHref>
@@ -56,7 +65,7 @@ export default function Grant({ post, markdown, search }) {
56 <h1>{post.title}</h1>
65 <h1>{post.title}</h1>
57 {post.extra.assignee ? (
66 {post.extra.assignee ? (
58 <div className="type-ui text-wall-500 mt-4">
67 <div className="type-ui text-wall-500 mt-4">
59− Grantee: {assigneeLink}
68+ Grantee(s): {assigneeLink}
60 </div>
69 </div>
61 ) : null}
70 ) : null}
62 {post.extra.mentor ? (
71 {post.extra.mentor ? (
pages/index.js+61−49
@@ -47,7 +47,6 @@ export default function Home({
47 // Hero
47 // Hero
48 }
48 }
49 <Section>
49 <Section>
50−
51 <div className="bg-yellow-100 dark:bg-[#5C5037] w-full p-8 md:p-12 rounded-3xl flex flex-col md:flex-row">
50 <div className="bg-yellow-100 dark:bg-[#5C5037] w-full p-8 md:p-12 rounded-3xl flex flex-col md:flex-row">
52 <div className="md:w-10/12 w-full md:mr-6">
51 <div className="md:w-10/12 w-full md:mr-6">
53 <h2 className="m-0 p-0 mr-4 pb-6">Assembly 2022</h2>
52 <h2 className="m-0 p-0 mr-4 pb-6">Assembly 2022</h2>
@@ -172,44 +171,44 @@ export default function Home({
172 // Build on Urbit Developer CTA
171 // Build on Urbit Developer CTA
173 }
172 }
174 <Section narrow>
173 <Section narrow>
175− <h2 className="pb-8">Build on Urbit</h2>
174+ <h2 className="pb-8">Build on Urbit</h2>
176− <h4 className="pb-6">
175+ <h4 className="pb-6">
177− Urbit is a personal OS designed from scratch to run peer-to-peer
176+ Urbit is a personal OS designed from scratch to run peer-to-peer
178− applications.
177+ applications.
179− </h4>
178+ </h4>
180− <p className="pb-6">
179+ <p className="pb-6">
181− It solves the hard problems of implementing a peer-to-peer network
180+ It solves the hard problems of implementing a peer-to-peer network
182− (including identity, NAT traversal, and exactly-once delivery) in
181+ (including identity, NAT traversal, and exactly-once delivery) in
183− the kernel so app developers can focus on business logic.
182+ the kernel so app developers can focus on business logic.
184− </p>
183+ </p>
185− <p className="pb-6">
184+ <p className="pb-6">
186− The entire OS is a{" "}
185+ The entire OS is a{" "}
187− <Link href="https://urbit.org/docs/nock/definition/" passHref>
186+ <Link href="https://urbit.org/docs/nock/definition/" passHref>
188− <a>single pure function</a>
187+ <a>single pure function</a>
189− </Link>{" "}
188+ </Link>{" "}
190− that provides application developers with strong guarantees:
189+ that provides application developers with strong guarantees:
191− automated persistence and memory management, repeatable builds,
190+ automated persistence and memory management, repeatable builds, and
192− and support for hot code reloading.
191+ support for hot code reloading.
193− </p>
192+ </p>
194− <p className="pb-10">
193+ <p className="pb-10">
195− You can get started learning how to{" "}
194+ You can get started learning how to{" "}
196− <Link href="https://urbit.org/docs/development/develop/" passHref>
195+ <Link href="https://urbit.org/docs/development/develop/" passHref>
197− <a>contribute to the project</a>
196+ <a>contribute to the project</a>
198− </Link>
199− , or view a variety of{" "}
200− <Link
201− href="https://github.com/urbit/awesome-urbit#http-apis-airlock"
202− passHref
203− >
204− <a>libraries</a>
205− </Link>{" "}
206− for building on Urbit using the languages you already know.
207− </p>
208− <Link href="https://developers.urbit.org" passHref>
209− <a className="button-lg type-ui text-white bg-green-400 max-w-fit">
210− Visit Urbit Developers
211− </a>
212 </Link>
197 </Link>
198+ , or view a variety of{" "}
199+ <Link
200+ href="https://github.com/urbit/awesome-urbit#http-apis-airlock"
201+ passHref
202+ >
203+ <a>libraries</a>
204+ </Link>{" "}
205+ for building on Urbit using the languages you already know.
206+ </p>
207+ <Link href="https://developers.urbit.org" passHref>
208+ <a className="button-lg type-ui text-white bg-green-400 max-w-fit">
209+ Visit Urbit Developers
210+ </a>
211+ </Link>
213 </Section>
212 </Section>
214
213
215 {
214 {
@@ -261,14 +260,29 @@ export default function Home({
261
260
262 <Section narrow>
261 <Section narrow>
263 <h2 className="pb-8">Social Media</h2>
262 <h2 className="pb-8">Social Media</h2>
263+ <p className="pb-2">
264− <p className="pb-2">Follow us on <Link href="http://twitter.com/urbit">Twitter</Link></p>
264+ Follow us on <Link href="http://twitter.com/urbit">Twitter</Link>
265+ </p>
266+ <p className="pb-2">
267+ Check out our posts on{" "}
265− <p className="pb-2">Check out our posts on <Link href="http://instagram.com/urbit">Instagram</Link></p>
268+ <Link href="http://instagram.com/urbit">Instagram</Link>
269+ </p>
270+ <p className="pb-2">
271+ Watch livestreams on{" "}
266− <p className="pb-2">Watch livestreams on <Link href="https://www.youtube.com/channel/UCNYIS9_SktINCC9yqO4CFZw">YouTube</Link></p>
272+ <Link href="https://www.youtube.com/channel/UCNYIS9_SktINCC9yqO4CFZw">
273+ YouTube
274+ </Link>
275+ </p>
276+ <p className="pb-2">
267− <p className="pb-2">Dig into code on <Link href="http://github.com/urbit">Github</Link></p>
277+ Dig into code on <Link href="http://github.com/urbit">Github</Link>
278+ </p>
279+ <p className="pb-2">
280+ Boot Urbit and join{" "}
268− <p className="pb-2">Boot Urbit and join <Link href="https://urbit.org/groups/~bitbet-bolbel/urbit-community">Urbit Community</Link></p>
281+ <Link href="https://urbit.org/groups/~bitbet-bolbel/urbit-community">
282+ Urbit Community
283+ </Link>
284+ </p>
269 </Section>
285 </Section>
270−
271−
272 </SingleColumn>
286 </SingleColumn>
273 <Footer />
287 <Footer />
274 </Container>
288 </Container>
@@ -346,15 +360,13 @@ export async function getStaticProps() {
346 0
360 0
347 )
361 )
348 ),
362 ),
349− contributors: [
350− ...new Set(...[grants.map((e) => e.extra.assignee.split(","))]),
363+ contributors: [...new Set(...[grants.map((e) => e.extra.assignee)])].length,
351− ].length,
352 active: grants.filter(
364 active: grants.filter(
353 (e) =>
365 (e) =>
354 !e.extra.canceled &&
366 !e.extra.canceled &&
355 !e.extra.completed &&
367 !e.extra.completed &&
356 e.extra.assignee &&
368 e.extra.assignee &&
357− e.extra.assignee.length > 0
369+ e.extra.assignee?.[0]?.length > 0
358 ).length,
370 ).length,
359 };
371 };
360
372