on master help sign in
Fix miscellaneous issues with the grants page (#1107)
f41c26dJosh Lehman
content/grants/ethereum-abi-parser.md+1
@@ -13,6 +13,7 @@ reward = 2
13assignee = "xiphiness"
13assignee = "xiphiness"
14id = "1241532070"
14id = "1241532070"
15completed = false
15completed = false
16+canceled = true
16link = ""
17link = ""
17+++
18+++
18
19
content/grants/matrices-in-hoon.md+1−1
@@ -12,7 +12,7 @@ description = "Add array types to Hoon."
12reward = 5
12reward = 5
13assignee = "N E Davis"
13assignee = "N E Davis"
14id = "611660914"
14id = "611660914"
15−completed = false
15+completed = true
16link = ""
16link = ""
17+++
17+++
18
18
lib/lib.js+1−1
@@ -182,7 +182,7 @@ export function formatTimeZone(dateTimeObject) {
182
182
183// Formats a DateTime object to something like "Jul 15, 2021"
183// Formats a DateTime object to something like "Jul 15, 2021"
184export function formatDate(dateTimeObject) {
184export function formatDate(dateTimeObject) {
185− return dateTimeObject.toLocaleString(DateTime.DATE_HUGE);
185+ return dateTimeObject.toLocaleString(DateTime.DATE_FULL);
186}
186}
187
187
188// export function generateCrumbs(path) {
188// export function generateCrumbs(path) {
pages/grants.js+10−3
@@ -106,12 +106,19 @@ export default function Grants({
106 activeTags.includes(category)
106 activeTags.includes(category)
107 );
107 );
108
108
109+ const notCanceled = !post.extra.canceled;
110+
109 const noTagsSelected = activeTags.length === 0;
111 const noTagsSelected = activeTags.length === 0;
110 const hasType = post.taxonomies.grant_type.some((type) =>
112 const hasType = post.taxonomies.grant_type.some((type) =>
111 activeTypes.includes(type)
113 activeTypes.includes(type)
112 );
114 );
113
115
116+ return (
114− return (hasCategory || noTagsSelected) && byStatus(post) && hasType;
117+ (hasCategory || noTagsSelected) &&
118+ byStatus(post) &&
119+ hasType &&
120+ notCanceled
121+ );
115 });
122 });
116
123
117 const allCount = postsByStatus.length;
124 const allCount = postsByStatus.length;
@@ -262,13 +269,13 @@ export default function Grants({
262 post={giftPosts[0]}
269 post={giftPosts[0]}
263 className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
270 className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
264 key={giftPosts[0].slug}
271 key={giftPosts[0].slug}
265− section={giftPosts[0].section}
272+ section="updates"
266 />
273 />
267 <PostPreview
274 <PostPreview
268 post={giftPosts[1]}
275 post={giftPosts[1]}
269 className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
276 className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
270 key={giftPosts[1].slug}
277 key={giftPosts[1].slug}
271− section={giftPosts[1].section}
278+ section="blog"
272 />
279 />
273 </div>
280 </div>
274 </div>
281 </div>
pages/grants/[slug].js+2−1
@@ -17,6 +17,7 @@ import Footer from "../../components/Footer";
17import SingleColumn from "../../components/SingleColumn";
17import SingleColumn from "../../components/SingleColumn";
18import GrantPreview from "../../components/GrantPreview";
18import GrantPreview from "../../components/GrantPreview";
19import Section from "../../components/Section";
19import Section from "../../components/Section";
20+import { DateTime } from "luxon";
20
21
21export default function Grant({ post, markdown, search, similarGrants }) {
22export default function Grant({ post, markdown, search, similarGrants }) {
22 const router = useRouter();
23 const router = useRouter();
@@ -47,7 +48,7 @@ export default function Grant({ post, markdown, search, similarGrants }) {
47 </div>
48 </div>
48 ) : null}
49 ) : null}
49 <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
50 <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))}
51 </div>
52 </div>
52 <div className="flex items-center flex-wrap mt-4 md:mt-8 lg:mt-10">
53 <div className="flex items-center flex-wrap mt-4 md:mt-8 lg:mt-10">
53 {post.taxonomies.grant_type.map((category) => {
54 {post.taxonomies.grant_type.map((category) => {