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

grants: tweaks as per @mikeosborne

commit42f05984424135dd852716e3e627317f762e50dd authormatildepark <matilde.park@urbit.org> dateFri 6 May 2022, 14:24 (4 years ago) parent56159d7b540a00
1 file changed+37−2
pages/grants/[slug].js+37−2
pages/grants/[slug].js+37−2
@@ -17,6 +17,7 @@ import Header from "../../components/Header";
1717import Footer from "../../components/Footer";
1818import SingleColumn from "../../components/SingleColumn";
1919import GrantPreview from "../../components/GrantPreview";
20+import ob from "urbit-ob";
2021import Section from "../../components/Section";
2122import { DateTime } from "luxon";
2223
@@ -27,6 +28,24 @@ export default function Grant({ post, markdown, search }) {
2728 }
2829 const isOpen = !post?.extra?.completed && post?.extra?.assignee === "";
2930 const canApply = isOpen && post?.extra?.work_request_link;
31+ const assignee = post?.extra?.assignee;
32+ const mentor = post.extra.mentor || post.extra.champion;
33+ const assigneeLink =
34+ assignee && ob.isValidPatp(assignee) ? (
35+ <Link href={`/ids/${assignee}`} passHref>
36+ <a className="text-green-400">{assignee}</a>
37+ </Link>
38+ ) : (
39+ assignee
40+ );
41+ const mentorLink =
42+ mentor && ob.isValidPatp(mentor) ? (
43+ <Link href={`/ids/${mentor}`} passHref>
44+ <a className="text-green-400">{mentor}</a>
45+ </Link>
46+ ) : (
47+ mentor
48+ );
3049
3150 return (
3251 <Container>
@@ -40,7 +59,17 @@ export default function Grant({ post, markdown, search }) {
4059 <h1>{post.title}</h1>
4160 {post.extra.assignee ? (
4261 <div className="type-ui text-wall-500 mt-4">
43− Grantee: {post.extra.assignee}
62+ Grantee: {assigneeLink}
63+ </div>
64+ ) : null}
65+ {post.extra.mentor ? (
66+ <div className="type-ui text-wall-500 mt-4">
67+ Mentor: {mentorLink}
68+ </div>
69+ ) : null}
70+ {post.extra.champion ? (
71+ <div className="type-ui text-wall-500 mt-4">
72+ Champion: {mentorLink}
4473 </div>
4574 ) : null}
4675 {post.extra.ship ? (
@@ -50,8 +79,14 @@ export default function Grant({ post, markdown, search }) {
5079 </a>
5180 </Link>
5281 ) : null}
53− <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
82+ <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10 flex items-center space-x-1">
5483 {formatDate(DateTime.fromISO(post.date))}
84+ {post?.extra?.grant_id ? (
85+ <>
86+ <p className="ml-1 text-wall-500 type-ui">• ID:</p>
87+ <p className="font-mono type-ui"> {post.extra.grant_id}</p>
88+ </>
89+ ) : null}
5590 </div>
5691 <div className="flex items-center flex-wrap mt-4 md:mt-8 lg:mt-10">
5792 {post.taxonomies.grant_type.map((category) => {