on master help sign in
pages, components: clean up imports
8778757Matilde Park
components/BasicPage.js+1−1
@@ -10,7 +10,7 @@ import Section from "./Section";
10import { decode } from "html-entities";
10import { decode } from "html-entities";
11import Markdown from "./Markdown";
11import Markdown from "./Markdown";
12
12
13−export default function BasicPage({ post, markdown, search }) {
13+export default function BasicPage({ post, search }) {
14 const router = useRouter();
14 const router = useRouter();
15 if (!router.isFallback && !post?.slug) {
15 if (!router.isFallback && !post?.slug) {
16 return <ErrorPage />;
16 return <ErrorPage />;
components/GrantProgramOverview.js+1
@@ -11,6 +11,7 @@ import SingleColumn from "./SingleColumn";
11import Section from "./Section";
11import Section from "./Section";
12import { decode } from "html-entities";
12import { decode } from "html-entities";
13import { DateTime } from "luxon";
13import { DateTime } from "luxon";
14+import Markdown from "./Markdown";
14
15
15export default function GrantProgramOverview({
16export default function GrantProgramOverview({
16 post,
17 post,
components/gateway/Description.js+5−1
@@ -6,7 +6,11 @@ const Description = ({ description, fallback, markdown }) => {
6 (description !== fallback || markdown) && (
6 (description !== fallback || markdown) && (
7 <div className="flex flex-col space-y-4">
7 <div className="flex flex-col space-y-4">
8 <p className="font-bold text-wall-400">Description</p>
8 <p className="font-bold text-wall-400">Description</p>
9+ {markdown ? (
9− {markdown ? <Markdown post={markdown} /> : <p>{description}</p>}
10+ <Markdown post={{ content: markdown }} />
11+ ) : (
12+ <p>{description}</p>
13+ )}
10 </div>
14 </div>
11 )
15 )
12 );
16 );
pages/blog/[slug].js+1−7
@@ -22,13 +22,7 @@ import TwoUp from "../../components/TwoUp";
22import { decode } from "html-entities";
22import { decode } from "html-entities";
23import Markdown from "../../components/Markdown";
23import Markdown from "../../components/Markdown";
24
24
25−export default function Post({
25+export default function Post({ post, nextPost, previousPost, search }) {
26− post,
27− nextPost,
28− previousPost,
29− markdown,
30− search,
31−}) {
32 const router = useRouter();
26 const router = useRouter();
33 if (!router.isFallback && !post?.slug) {
27 if (!router.isFallback && !post?.slug) {
34 return <ErrorPage />;
28 return <ErrorPage />;
pages/events/[slug].js+1−7
@@ -32,13 +32,7 @@ import {
32import { decode } from "html-entities";
32import { decode } from "html-entities";
33import { eventKeys } from "../../lib/constants";
33import { eventKeys } from "../../lib/constants";
34
34
35−export default function Event({
35+export default function Event({ event, nextEvent, previousEvent, search }) {
36− event,
37− nextEvent,
38− previousEvent,
39− markdown,
40− search,
41−}) {
42 const starts = generateDisplayDate(event.starts, event.timezone);
36 const starts = generateDisplayDate(event.starts, event.timezone);
43 const ends = generateDisplayDate(event.ends, event.timezone);
37 const ends = generateDisplayDate(event.ends, event.timezone);
44
38
pages/grants/[slug].js+1−1
@@ -21,7 +21,7 @@ import ob from "urbit-ob";
21import Section from "../../components/Section";
21import Section from "../../components/Section";
22import { DateTime } from "luxon";
22import { DateTime } from "luxon";
23
23
24−export default function Grant({ post, markdown, search }) {
24+export default function Grant({ post, search }) {
25 const router = useRouter();
25 const router = useRouter();
26 if (!router.isFallback && !post?.slug) {
26 if (!router.isFallback && !post?.slug) {
27 return <ErrorPage />;
27 return <ErrorPage />;
pages/grants/bounties.js+2−6
@@ -1,13 +1,11 @@
1import { getPostBySlug } from "../../lib/lib";
1import { getPostBySlug } from "../../lib/lib";
2import GrantProgramOverview from "../../components/GrantProgramOverview";
2import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import Markdown from "../../components/Markdown";
4
3
5−export default function Post({ post, markdown, search }) {
4+export default function Post({ post, search }) {
6 return (
5 return (
7 <GrantProgramOverview
6 <GrantProgramOverview
8 program="bounties"
7 program="bounties"
9 post={post}
8 post={post}
10− markdown={markdown}
11 search={search}
9 search={search}
12 actionText="View Open Bounties"
10 actionText="View Open Bounties"
13 actionLink="/grants?program=bounty&open=true&wip=false#view-grants"
11 actionLink="/grants?program=bounty&open=true&wip=false#view-grants"
@@ -22,9 +20,7 @@ export async function getStaticProps() {
22 "/"
20 "/"
23 );
21 );
24
22
25− const markdown = await Markdown({ post });
26−
27 return {
23 return {
28− props: { post, markdown },
24+ props: { post },
29 };
25 };
30}
26}
pages/grants/proposals.js+1−1
@@ -21,6 +21,6 @@ export async function getStaticProps() {
21 );
21 );
22
22
23 return {
23 return {
24− props: { post, markdown },
24+ props: { post },
25 };
25 };
26}
26}
pages/ids/[id].js−1
@@ -6,7 +6,6 @@ import Container from "../../components/Container";
6import SingleColumn from "../../components/SingleColumn";
6import SingleColumn from "../../components/SingleColumn";
7import Section from "../../components/Section";
7import Section from "../../components/Section";
8import ob from "urbit-ob";
8import ob from "urbit-ob";
9−import Markdown from "../../components/Markdown";
10import ResourceCard from "../../components/ResourceCard";
9import ResourceCard from "../../components/ResourceCard";
11import GatewayHeader from "../../components/gateway/GatewayHeader";
10import GatewayHeader from "../../components/gateway/GatewayHeader";
12import Gateway404 from "../../components/gateway/Gateway404";
11import Gateway404 from "../../components/gateway/Gateway404";
pages/terms-of-service.js−1
@@ -1,6 +1,5 @@
1import { getPostBySlug } from "../lib/lib";
1import { getPostBySlug } from "../lib/lib";
2import PageWithIndex from "../components/PageWithIndex";
2import PageWithIndex from "../components/PageWithIndex";
3−import Markdown from "../components/Markdown";
4
3
5export default function Post({ post, search }) {
4export default function Post({ post, search }) {
6 return <PageWithIndex post={post} search={search} />;
5 return <PageWithIndex post={post} search={search} />;
pages/updates/[slug].js+1−7
@@ -20,13 +20,7 @@ import Contact from "../../components/Contact";
20
20
21import { decode } from "html-entities";
21import { decode } from "html-entities";
22
22
23−export default function Post({
23+export default function Post({ post, nextPost, previousPost, search }) {
24− post,
25− nextPost,
26− previousPost,
27− markdown,
28− search,
29−}) {
30 const router = useRouter();
24 const router = useRouter();
31 if (!router.isFallback && !post?.slug) {
25 if (!router.isFallback && !post?.slug) {
32 return <ErrorPage />;
26 return <ErrorPage />;
pages/voting-instructions.js+1−1
@@ -1,7 +1,7 @@
1import { getPostBySlug } from "../lib/lib";
1import { getPostBySlug } from "../lib/lib";
2import BasicPage from "../components/BasicPage";
2import BasicPage from "../components/BasicPage";
3
3
4−export default function Post({ post, markdown, search }) {
4+export default function Post({ post, search }) {
5 return <BasicPage post={post} search={search} />;
5 return <BasicPage post={post} search={search} />;
6}
6}
7
7