on master help sign in
finish adding <Section/>
commit585d821a86cb38de4093b9fa096653544c1dac38 authorGavin Atkinson <gvnatknsn@protonmail.com> dateTue 13 Jul 2021, 12:32 (5 years ago) parent0e1e544
10 files changed+57−70
components/BasicPage.js+5−4 components/ContactSection.js+2−2 components/Footer.js+13−14 components/GrantPreview.js+9−10 components/Header.js+1−2 pages/404.js+3−2 pages/events/[slug].js+11−10 pages/grants.js+11−8 pages/grants/[slug].js+2−2 styles/globals.css−16
components/BasicPage.js+5−4
@@ -4,6 +4,7 @@ import Container from "./Container";
44import Header from "./Header";
55import Footer from "./Footer";
66import SingleColumn from "./SingleColumn";
7+import Section from "./Section";
78import markdownStyles from "../styles/markdown.module.css";
89import { decode } from "html-entities";
910
@@ -16,14 +17,14 @@ export default function BasicPage({ post, markdown, search }) {
1617 <Container>
1718 <SingleColumn>
1819 <Header search={search} />
19− <section className="flex flex-col layout-narrow">
20+ <Section narrow>
2021 <h1>{post.title}</h1>
21− </section>
22− <div className={"layout-narrow " + markdownStyles["markdown"]}>
22+ </Section>
23+ <Section narrow className={markdownStyles["markdown"]}>
2324 <article
2425 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
2526 ></article>
26− </div>
27+ </Section>
2728 </SingleColumn>
2829 <Footer />
2930 </Container>
components/ContactSection.js+2−2
@@ -3,7 +3,7 @@ import { name, contact } from "../../lib/constants";
33
44export default function () {
55 return (
6− <section className="layout-narrow">
6+ <Section narrow>
77 <div className="measure">
88 <h4 className="pb-6">
99 If you’d like to follow our progress, we send monthly updates via
@@ -33,6 +33,6 @@ export default function () {
3333 Boot Urbit and join{" "}
3434 <code className="bg-wall p-2 rounded-lg">{contact.urbitCommunity}</code>
3535 </h4>
36− </section>
36+ </Section>
3737 );
3838}
components/Footer.js+13−14
@@ -1,12 +1,13 @@
11import Link from "next/link";
22import SingleColumn from "./SingleColumn";
3+import Section from "./Section";
34import { contact } from "../lib/constants";
45
56export default function Footer() {
67 return (
7− <footer className="pt-16 md:pt-20 lg:pt-24 bg-wall w-full mt-48 flex justify-center">
8+ <footer className="py-16 bg-wall w-full mt-48 flex justify-center">
89 <SingleColumn>
9− <div className="flex layout-wide-short">
10+ <Section short className="flex">
1011 <div className="w-1/3 flex flex-col flex-shrink">
1112 <h4 className="mb-8">Use Urbit</h4>
1213 <Link href="">
@@ -66,8 +67,8 @@ export default function Footer() {
6667 </div>
6768 </Link>
6869 </div>
69− </div>
70− <div className="flex layout-wide-short">
70+ </Section>
71+ <Section short className="flex">
7172 <div className="w-1/3 flex flex-col">
7273 <h4 className="mb-8">Develop</h4>
7374 <Link href="/docs">
@@ -122,30 +123,28 @@ export default function Footer() {
122123 </div>
123124 </Link>
124125 </div>
125− </div>
126− <div className="flex layout-wide-short">
126+ </Section>
127+ <Section short className="flex">
127128 <div className="w-1/3">
128− <Link href="">
129+ <Link href="/privacy">
129130 <div>
130131 <a className="type-sub text-gray">Privacy Policy</a>
131132 </div>
132133 </Link>
133134 </div>
134135 <div className="w-1/3">
135− <Link href="">
136+ <Link href="/terms-of-service">
136137 <div>
137138 <a className="type-sub text-gray">Terms of Service</a>
138139 </div>
139140 </Link>
140141 </div>
141142 <div className="w-1/3">
142− <Link href="">
143− <div>
144− <a className="type-sub text-gray">{contact.email}</a>
145− </div>
146− </Link>
143+ <div>
144+ <a className="type-sub text-gray">{"mailto:" + contact.email}</a>
145+ </div>
147146 </div>
148− </div>
147+ </Section>
149148 </SingleColumn>
150149 </footer>
151150 );
components/GrantPreview.js+9−10
@@ -1,22 +1,21 @@
11import classnames from "classnames";
22import Link from "next/link";
33
4−export default function GrantPreview({ post }) {
5− console.log(post);
4+export default function GrantPreview({ grant }) {
65 return (
7− <div key={post.slug} className="mb-4 cursor-pointer bg-wall rounded-lg">
8− <Link href={`/grants/${post.slug}`}>
6+ <div key={grant.slug} className="mb-4 cursor-pointer bg-wall rounded-lg">
7+ <Link href={`/grants/${grant.slug}`}>
98 <div className="p-8">
10− <h3 className="type-ui mb-4">{post.title}</h3>
11− <p className="mb-4">{post.extra.description}</p>
9+ <h3 className="type-ui mb-4">{grant.title}</h3>
10+ <p className="mb-4">{grant.extra.description}</p>
1211 <div className="flex w-full flex-col md:flex-row md:items-center justify-between">
1312 <p className="text-gray">
1413 <strong>Reward: </strong>
15− {post.extra.reward} star
16− {post.extra.reward === 1 ? "" : "s"}
14+ {grant.extra.reward} star
15+ {grant.extra.reward === 1 ? "" : "s"}
1716 </p>
1817 <div className="flex items-center flex-wrap md:mt-0 mt-4">
19− {post.taxonomies.grant_type.map((category) => {
18+ {grant.taxonomies.grant_type.map((category) => {
2019 const className = classnames({
2120 "bg-blue text-white": category === "Proposal",
2221 "bg-green text-white": category === "Apprenticeship",
@@ -28,7 +27,7 @@ export default function GrantPreview({ post }) {
2827 </div>
2928 );
3029 })}
31− {post.taxonomies.grant_category.map((category) => (
30+ {grant.taxonomies.grant_category.map((category) => (
3231 <div className="bg-gray text-wall badge-sm mr-1 my-1">
3332 {category}
3433 </div>
components/Header.js+1−2
@@ -23,12 +23,11 @@ function ActiveLink({ children, href, className }) {
2323 );
2424}
2525
26−// This is the header for the index page
2726export default function Header(props) {
2827 const [isOpen, toggleTray] = useState(false);
2928
3029 return (
31− <header className="w-full md:w-10/12 flex flex-row justify-between items-center py-8 md:py-10 lg:py-12">
30+ <header className="w-full px-4 md:px-8 md:w-10/12 flex flex-row justify-between items-center pt-8 md:pt-10 lg:pt-12 pb-10 md:pb-12 lg:pb-24">
3231 <Link href="/">
3332 <a className="type-ui">Urbit</a>
3433 </Link>
pages/404.js+3−2
@@ -2,16 +2,17 @@ import Container from "../components/Container";
22import SingleColumn from "../components/SingleColumn";
33import Header from "../components/Header";
44import Footer from "../components/Footer";
5+import Section from "../components/Section";
56
67export default function NotFound(props) {
78 return (
89 <Container>
910 <SingleColumn>
1011 <Header search={props.search} />
11− <section className="layout-wide pt-48">
12+ <Section className="pt-48">
1213 <h1>404</h1>
1314 <p className="mt-12">It looks like nothing is here.</p>
14− </section>
15+ </Section>
1516 </SingleColumn>
1617 <Footer />
1718 </Container>
pages/events/[slug].js+11−10
@@ -17,6 +17,7 @@ import BackgroundImage from "../../components/BackgroundImage";
1717import SingleColumn from "../../components/SingleColumn";
1818import NewsletterSignup from "../../components/NewletterSignup";
1919import PostPreview from "../../components/PostPreview";
20+import Section from "../../components/Section";
2021import { name, contact } from "../../lib/constants";
2122import markdownStyles from "../../styles/markdown.module.css";
2223import { decode } from "html-entities";
@@ -36,7 +37,7 @@ export default function Event({
3637 <Container>
3738 <SingleColumn>
3839 <Header search={search} />
39− <section className="flex flex-col layout-narrow-heading pt-24">
40+ <Section narrow short>
4041 <h1>{post.title}</h1>
4142 {post.extra.author ? (
4243 <div className="type-ui text-gray mt-4 md:mt-8 lg:mt-10">
@@ -49,8 +50,8 @@ export default function Event({
4950 <div className="type-ui text-gray mt-16">
5051 {formatDate(new Date(post.date))}
5152 </div>
52− </section>
53− <section className="flex layout-narrow pt-24">
53+ </Section>
54+ <Section narrow>
5455 {post.extra.youtube ? (
5556 <iframe
5657 className="rounded-xl"
@@ -62,14 +63,14 @@ export default function Event({
6263 allowfullscreen
6364 ></iframe>
6465 ) : null}
65− </section>
66− <div className={"layout-narrow " + markdownStyles["markdown"]}>
66+ </Section>
67+ <Section narrow className={markdownStyles["markdown"]}>
6768 <article
6869 className="flex flex-col items-center pt-12 w-full"
6970 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
7071 ></article>
71− </div>
72− <section className="layout-narrow pt-24">
72+ </Section>
73+ <Section narrow>
7374 <div className="measure">
7475 <h4 className="pb-6">
7576 If you’d like to follow our progress, we send monthly updates via
@@ -101,8 +102,8 @@ export default function Event({
101102 {contact.urbitCommunity}
102103 </code>
103104 </h4>
104− </section>
105− <section className="layout-wide pt-24 flex">
105+ </Section>
106+ <Section wide>
106107 {previousPost === null ? (
107108 <div className={"w-1/2 mr-4"} />
108109 ) : (
@@ -121,7 +122,7 @@ export default function Event({
121122 className="ml-4 w-1/2"
122123 />
123124 )}
124− </section>
125+ </Section>
125126 </SingleColumn>
126127 <Footer />
127128 </Container>
pages/grants.js+11−8
@@ -9,6 +9,7 @@ import Search from "../components/Search";
99import SingleColumn from "../components/SingleColumn";
1010import BackgroundImage from "../components/BackgroundImage";
1111import TabCarousel from "../components/TabCarousel";
12+import Section from "../components/Section";
1213import GrantPreview from "../components/GrantPreview";
1314import {
1415 getAllPosts,
@@ -90,6 +91,8 @@ export default function Grants({
9091 );
9192 });
9293
94+ console.log("filteredPosts:", filteredPosts);
95+
9396 return (
9497 <Container>
9598 <SingleColumn>
@@ -97,7 +100,7 @@ export default function Grants({
97100 {
98101 // Heading and introduction
99102 }
100− <section className="layout-wide">
103+ <Section wide>
101104 <div className="measure pb-16">
102105 <h2 className="pb-16">Urbit Grants</h2>
103106 <p className="mb-8">
@@ -122,11 +125,11 @@ export default function Grants({
122125 — Urbit Community Member <pre>~radbur-sivmus</pre>
123126 </p>
124127 </div>
125− </section>
128+ </Section>
126129 {
127130 // Featured Grants
128131 }
129− <section className="layout-wide">
132+ <Section wide>
130133 <div className="measure pb-16">
131134 <h2 className="pb-16">Featured Grants</h2>
132135 <p className="mb-8">
@@ -151,23 +154,23 @@ export default function Grants({
151154 );
152155 })}
153156 </div>
154− </section>
157+ </Section>
155158
156159 {
157160 // Gift Grants
158161 }
159− <section className="layout-wide">
162+ <Section wide>
160163 <div className="measure pb-16">
161164 <h2 className="pb-16">Gifts</h2>
162165 <p className="mb-8">
163166 Gifts are given post facto for exceptional contributions.
164167 </p>
165168 </div>
166− </section>
169+ </Section>
167170 {
168171 // Find a Grant
169172 }
170− <section className="layout-wide">
173+ <Section wide>
171174 <h2 className="pb-8">Find A Grant</h2>
172175 <h5 className="text-black font-semibold my-2">Work Programs</h5>
173176 <div className="flex flex-wrap items-center pb-2">
@@ -241,7 +244,7 @@ export default function Grants({
241244 {filteredPosts.map((post) => {
242245 return <GrantPreview grant={post} />;
243246 })}
244− </section>
247+ </Section>
245248 </SingleColumn>
246249 <Footer />
247250 </Container>
pages/grants/[slug].js+2−2
@@ -63,7 +63,7 @@ export default function Grant({ post, markdown, search, similarGrants }) {
6363 ))}
6464 </div>
6565 </Section>
66− <Section className={markdownStyles["markdown"]}>
66+ <Section narrow className={markdownStyles["markdown"]}>
6767 <article
6868 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
6969 ></article>
@@ -72,7 +72,7 @@ export default function Grant({ post, markdown, search, similarGrants }) {
7272 <Section narrow className="flex flex-col">
7373 <h3 className="pb-8">Similar Grants</h3>
7474 {similarGrants.map((grant) => {
75− return <GrantPreview post={grant} />;
75+ return <GrantPreview grant={grant} />;
7676 })}
7777 </Section>
7878 </SingleColumn>
styles/globals.css−16
@@ -17,22 +17,6 @@ p a {
1717 @apply text-green;
1818}
1919
20−/* .layout-narrow {
21− @apply w-full md:w-8/12 px-4 md:px-8 py-10 md:py-12 lg:py-24;
22−}
23−
24−.layout-wide {
25− @apply w-full md:w-10/12 px-4 md:px-8 py-10 md:py-12 lg:py-24;
26−}
27−
28−.layout-narrow-heading {
29− @apply w-full md:w-8/12 px-4 md:px-8 py-8 md:py-10 lg:py-12;
30−}
31−
32−.layout-wide-short {
33− @apply w-full md:w-10/12 px-4 md:px-8 py-8 md:py-10 lg:py-12;
34−} */
35−
3620h1,
3721.type-h1 {
3822 @apply text-4xl md:text-5xl lg:text-6xl font-bold leading-tight;