on master help sign in
Fix miscellaneous issues with the grants page (#1107)

* fix gift post link * don't show canceled posts * use correct date format in grants pages * update a couple of grants * remove errant log statement

commitf41c26d661b208f3966f06680f528482fbf60870 authorJosh Lehman <josh@urbit.org> dateWed 8 Sep 2021, 17:17 (5 years ago) parent7d82e8b
5 files changed+15−6
content/grants/ethereum-abi-parser.md+1 content/grants/matrices-in-hoon.md+1−1 lib/lib.js+1−1 pages/grants.js+10−3 pages/grants/[slug].js+2−1
content/grants/ethereum-abi-parser.md+1
@@ -13,6 +13,7 @@ reward = 2
1313assignee = "xiphiness"
1414id = "1241532070"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/matrices-in-hoon.md+1−1
@@ -12,7 +12,7 @@ description = "Add array types to Hoon."
1212reward = 5
1313assignee = "N E Davis"
1414id = "611660914"
15−completed = false
15+completed = true
1616link = ""
1717+++
1818
lib/lib.js+1−1
@@ -182,7 +182,7 @@ export function formatTimeZone(dateTimeObject) {
182182
183183// Formats a DateTime object to something like "Jul 15, 2021"
184184export function formatDate(dateTimeObject) {
185− return dateTimeObject.toLocaleString(DateTime.DATE_HUGE);
185+ return dateTimeObject.toLocaleString(DateTime.DATE_FULL);
186186}
187187
188188// export function generateCrumbs(path) {
pages/grants.js+10−3
@@ -106,12 +106,19 @@ export default function Grants({
106106 activeTags.includes(category)
107107 );
108108
109+ const notCanceled = !post.extra.canceled;
110+
109111 const noTagsSelected = activeTags.length === 0;
110112 const hasType = post.taxonomies.grant_type.some((type) =>
111113 activeTypes.includes(type)
112114 );
113115
114− return (hasCategory || noTagsSelected) && byStatus(post) && hasType;
116+ return (
117+ (hasCategory || noTagsSelected) &&
118+ byStatus(post) &&
119+ hasType &&
120+ notCanceled
121+ );
115122 });
116123
117124 const allCount = postsByStatus.length;
@@ -262,13 +269,13 @@ export default function Grants({
262269 post={giftPosts[0]}
263270 className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
264271 key={giftPosts[0].slug}
265− section={giftPosts[0].section}
272+ section="updates"
266273 />
267274 <PostPreview
268275 post={giftPosts[1]}
269276 className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
270277 key={giftPosts[1].slug}
271− section={giftPosts[1].section}
278+ section="blog"
272279 />
273280 </div>
274281 </div>
pages/grants/[slug].js+2−1
@@ -17,6 +17,7 @@ import Footer from "../../components/Footer";
1717import SingleColumn from "../../components/SingleColumn";
1818import GrantPreview from "../../components/GrantPreview";
1919import Section from "../../components/Section";
20+import { DateTime } from "luxon";
2021
2122export default function Grant({ post, markdown, search, similarGrants }) {
2223 const router = useRouter();
@@ -47,7 +48,7 @@ export default function Grant({ post, markdown, search, similarGrants }) {
4748 </div>
4849 ) : null}
4950 <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
50− {formatDate(new Date(post.date))}
51+ {formatDate(DateTime.fromISO(post.date))}
5152 </div>
5253 <div className="flex items-center flex-wrap mt-4 md:mt-8 lg:mt-10">
5354 {post.taxonomies.grant_type.map((category) => {