on master help sign in
pages, components: clean up imports
commit87787571a0a72cc99f98e830926dd40168a0ad83 authorMatilde Park <matilde.park@urbit.org> dateWed 1 Jun 2022, 16:41 (4 years ago) parent5c04c34
12 files changed+15−34
components/BasicPage.js+1−1 components/GrantProgramOverview.js+1 components/gateway/Description.js+5−1 pages/blog/[slug].js+1−7 pages/events/[slug].js+1−7 pages/grants/[slug].js+1−1 pages/grants/bounties.js+2−6 pages/grants/proposals.js+1−1 pages/ids/[id].js−1 pages/terms-of-service.js−1 pages/updates/[slug].js+1−7 pages/voting-instructions.js+1−1
components/BasicPage.js+1−1
@@ -10,7 +10,7 @@ import Section from "./Section";
1010import { decode } from "html-entities";
1111import Markdown from "./Markdown";
1212
13−export default function BasicPage({ post, markdown, search }) {
13+export default function BasicPage({ post, search }) {
1414 const router = useRouter();
1515 if (!router.isFallback && !post?.slug) {
1616 return <ErrorPage />;
components/GrantProgramOverview.js+1
@@ -11,6 +11,7 @@ import SingleColumn from "./SingleColumn";
1111import Section from "./Section";
1212import { decode } from "html-entities";
1313import { DateTime } from "luxon";
14+import Markdown from "./Markdown";
1415
1516export default function GrantProgramOverview({
1617 post,
components/gateway/Description.js+5−1
@@ -6,7 +6,11 @@ const Description = ({ description, fallback, markdown }) => {
66 (description !== fallback || markdown) && (
77 <div className="flex flex-col space-y-4">
88 <p className="font-bold text-wall-400">Description</p>
9− {markdown ? <Markdown post={markdown} /> : <p>{description}</p>}
9+ {markdown ? (
10+ <Markdown post={{ content: markdown }} />
11+ ) : (
12+ <p>{description}</p>
13+ )}
1014 </div>
1115 )
1216 );
pages/blog/[slug].js+1−7
@@ -22,13 +22,7 @@ import TwoUp from "../../components/TwoUp";
2222import { decode } from "html-entities";
2323import Markdown from "../../components/Markdown";
2424
25−export default function Post({
26− post,
27− nextPost,
28− previousPost,
29− markdown,
30− search,
31−}) {
25+export default function Post({ post, nextPost, previousPost, search }) {
3226 const router = useRouter();
3327 if (!router.isFallback && !post?.slug) {
3428 return <ErrorPage />;
pages/events/[slug].js+1−7
@@ -32,13 +32,7 @@ import {
3232import { decode } from "html-entities";
3333import { eventKeys } from "../../lib/constants";
3434
35−export default function Event({
36− event,
37− nextEvent,
38− previousEvent,
39− markdown,
40− search,
41−}) {
35+export default function Event({ event, nextEvent, previousEvent, search }) {
4236 const starts = generateDisplayDate(event.starts, event.timezone);
4337 const ends = generateDisplayDate(event.ends, event.timezone);
4438
pages/grants/[slug].js+1−1
@@ -21,7 +21,7 @@ import ob from "urbit-ob";
2121import Section from "../../components/Section";
2222import { DateTime } from "luxon";
2323
24−export default function Grant({ post, markdown, search }) {
24+export default function Grant({ post, search }) {
2525 const router = useRouter();
2626 if (!router.isFallback && !post?.slug) {
2727 return <ErrorPage />;
pages/grants/bounties.js+2−6
@@ -1,13 +1,11 @@
11import { getPostBySlug } from "../../lib/lib";
22import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import Markdown from "../../components/Markdown";
43
5−export default function Post({ post, markdown, search }) {
4+export default function Post({ post, search }) {
65 return (
76 <GrantProgramOverview
87 program="bounties"
98 post={post}
10− markdown={markdown}
119 search={search}
1210 actionText="View Open Bounties"
1311 actionLink="/grants?program=bounty&open=true&wip=false#view-grants"
@@ -22,9 +20,7 @@ export async function getStaticProps() {
2220 "/"
2321 );
2422
25− const markdown = await Markdown({ post });
26−
2723 return {
28− props: { post, markdown },
24+ props: { post },
2925 };
3026}
pages/grants/proposals.js+1−1
@@ -21,6 +21,6 @@ export async function getStaticProps() {
2121 );
2222
2323 return {
24− props: { post, markdown },
24+ props: { post },
2525 };
2626}
pages/ids/[id].js−1
@@ -6,7 +6,6 @@ import Container from "../../components/Container";
66import SingleColumn from "../../components/SingleColumn";
77import Section from "../../components/Section";
88import ob from "urbit-ob";
9−import Markdown from "../../components/Markdown";
109import ResourceCard from "../../components/ResourceCard";
1110import GatewayHeader from "../../components/gateway/GatewayHeader";
1211import Gateway404 from "../../components/gateway/Gateway404";
pages/terms-of-service.js−1
@@ -1,6 +1,5 @@
11import { getPostBySlug } from "../lib/lib";
22import PageWithIndex from "../components/PageWithIndex";
3−import Markdown from "../components/Markdown";
43
54export default function Post({ post, search }) {
65 return <PageWithIndex post={post} search={search} />;
pages/updates/[slug].js+1−7
@@ -20,13 +20,7 @@ import Contact from "../../components/Contact";
2020
2121import { decode } from "html-entities";
2222
23−export default function Post({
24− post,
25− nextPost,
26− previousPost,
27− markdown,
28− search,
29−}) {
23+export default function Post({ post, nextPost, previousPost, search }) {
3024 const router = useRouter();
3125 if (!router.isFallback && !post?.slug) {
3226 return <ErrorPage />;
pages/voting-instructions.js+1−1
@@ -1,7 +1,7 @@
11import { getPostBySlug } from "../lib/lib";
22import BasicPage from "../components/BasicPage";
33
4−export default function Post({ post, markdown, search }) {
4+export default function Post({ post, search }) {
55 return <BasicPage post={post} search={search} />;
66}
77