on master help sign in
pages: add intranav component
3e61015Matilde Park
components/BasicPage.js+3−1
@@ -7,6 +7,7 @@ import {
7 SingleColumn,
7 SingleColumn,
8 Section,
8 Section,
9 Markdown,
9 Markdown,
10+ IntraNav,
10} from "foundation-design-system";
11} from "foundation-design-system";
11import Header from "./Header";
12import Header from "./Header";
12import Footer from "./Footer";
13import Footer from "./Footer";
@@ -24,8 +25,9 @@ export default function BasicPage({ post, markdown, search, index = false }) {
24 <title>Urbit • {post.title}</title>
25 <title>Urbit • {post.title}</title>
25 {Meta(post)}
26 {Meta(post)}
26 </Head>
27 </Head>
28+ <IntraNav ourSite="https://urbit.org" search={search} />
27 <SingleColumn>
29 <SingleColumn>
28− <Header search={search} />
30+ <Header />
29 <Section narrow>
31 <Section narrow>
30 <h1>{post.title}</h1>
32 <h1>{post.title}</h1>
31 </Section>
33 </Section>
components/GrantProgramOverview.js+3−1
@@ -9,6 +9,7 @@ import {
9 Section,
9 Section,
10 SingleColumn,
10 SingleColumn,
11 Markdown,
11 Markdown,
12+ IntraNav,
12} from "foundation-design-system";
13} from "foundation-design-system";
13import Header from "./Header";
14import Header from "./Header";
14import Footer from "./Footer";
15import Footer from "./Footer";
@@ -34,8 +35,9 @@ export default function GrantProgramOverview({
34 <title>{title} • Grants • urbit.org</title>
35 <title>{title} • Grants • urbit.org</title>
35 {Meta(post)}
36 {Meta(post)}
36 </Head>
37 </Head>
38+ <IntraNav ourSite="https://urbit.org" search={search} />
37 <SingleColumn>
39 <SingleColumn>
38− <Header search={search} />
40+ <Header />
39 <Section narrow short>
41 <Section narrow short>
40 <h1>{post.title}</h1>
42 <h1>{post.title}</h1>
41 <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
43 <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
components/Header.js−26
@@ -22,7 +22,6 @@ function ActiveLink({ children, href, className, currentPath }) {
22
22
23export default function Header(props) {
23export default function Header(props) {
24 const [isOpen, setTray] = useState(false);
24 const [isOpen, setTray] = useState(false);
25− const [shortcut, setShortcut] = useState("");
26
25
27 const currentPath = useRouter().asPath;
26 const currentPath = useRouter().asPath;
28
27
@@ -30,21 +29,6 @@ export default function Header(props) {
30
29
31 const firstCrumb = currentPath.split("/")[1];
30 const firstCrumb = currentPath.split("/")[1];
32
31
33− const detectOS = () => {
34− const agent = window.navigator.appVersion;
35− if (agent.includes("Win")) {
36− return "Ctrl+K";
37− } else if (agent.includes("Mac")) {
38− return "⌘K";
39− } else if (agent.includes("Linux")) {
40− return "Ctrl+K";
41− }
42− };
43−
44− useEffect(() => {
45− setShortcut(detectOS());
46− }, []);
47−
48 return (
32 return (
49 <header className="layout px-4 md:px-8 flex justify-between items-center pt-8 md:pt-10 lg:pt-12 pb-10 md:pb-12 lg:pb-24">
33 <header className="layout px-4 md:px-8 flex justify-between items-center pt-8 md:pt-10 lg:pt-12 pb-10 md:pb-12 lg:pb-24">
50 <div>
34 <div>
@@ -105,16 +89,6 @@ export default function Header(props) {
105 >
89 >
106 FAQ
90 FAQ
107 </ActiveLink>
91 </ActiveLink>
108− <button
109− onClick={(e) => {
110− e.stopPropagation();
111− props.search.toggleSearch(e);
112− }}
113− className="bg-wall-100 text-wall-500 flex px-4 py-1 rounded-lg type-ui"
114− >
115− <div>Search</div>
116− <div className="ml-4 text-wall-400">{shortcut}</div>
117− </button>
118 </nav>
92 </nav>
119
93
120 {
94 {
package-lock.json+2−2
@@ -1091,7 +1091,7 @@
1091 },
1091 },
1092 "node_modules/foundation-design-system": {
1092 "node_modules/foundation-design-system": {
1093 "version": "0.0.0",
1093 "version": "0.0.0",
1094− "resolved": "git+ssh://git@github.com/urbit/foundation-design-system.git#a31bcd08731d3b787e2739ebf740a7c6b5a278d2",
1094+ "resolved": "git+ssh://git@github.com/urbit/foundation-design-system.git#3039c76cf3840ebf903fca3216e17fc5cb29939b",
1095 "license": "MIT",
1095 "license": "MIT",
1096 "dependencies": {
1096 "dependencies": {
1097 "@markdoc/markdoc": "0.1.2",
1097 "@markdoc/markdoc": "0.1.2",
@@ -3556,7 +3556,7 @@
3556 "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA=="
3556 "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA=="
3557 },
3557 },
3558 "foundation-design-system": {
3558 "foundation-design-system": {
3559− "version": "git+ssh://git@github.com/urbit/foundation-design-system.git#a31bcd08731d3b787e2739ebf740a7c6b5a278d2",
3559+ "version": "git+ssh://git@github.com/urbit/foundation-design-system.git#3039c76cf3840ebf903fca3216e17fc5cb29939b",
3560 "from": "foundation-design-system@github:urbit/foundation-design-system",
3560 "from": "foundation-design-system@github:urbit/foundation-design-system",
3561 "requires": {
3561 "requires": {
3562 "@markdoc/markdoc": "0.1.2",
3562 "@markdoc/markdoc": "0.1.2",
pages/404.js+8−2
@@ -1,6 +1,11 @@
1import Head from "next/head";
1import Head from "next/head";
2import Meta from "../components/Meta";
2import Meta from "../components/Meta";
3+import {
4+ Container,
5+ SingleColumn,
6+ Section,
7+ IntraNav,
3−import { Container, SingleColumn, Section } from "foundation-design-system";
8+} from "foundation-design-system";
4import Header from "../components/Header";
9import Header from "../components/Header";
5import Footer from "../components/Footer";
10import Footer from "../components/Footer";
6
11
@@ -14,8 +19,9 @@ export default function NotFound(props) {
14 <title>404 • urbit.org</title>
19 <title>404 • urbit.org</title>
15 {Meta(post)}
20 {Meta(post)}
16 </Head>
21 </Head>
22+ <IntraNav ourSite="https://urbit.org" search={props.search} />
17 <SingleColumn>
23 <SingleColumn>
18− <Header search={props.search} />
24+ <Header />
19 <Section className="pt-48">
25 <Section className="pt-48">
20 <h1>404</h1>
26 <h1>404</h1>
21 <p className="mt-12">It looks like nothing is here.</p>
27 <p className="mt-12">It looks like nothing is here.</p>
pages/blog.js+8−2
@@ -1,7 +1,12 @@
1import Head from "next/head";
1import Head from "next/head";
2import Meta from "../components/Meta";
2import Meta from "../components/Meta";
3import Link from "next/link";
3import Link from "next/link";
4+import {
5+ Container,
6+ SingleColumn,
7+ Section,
8+ IntraNav,
4−import { Container, SingleColumn, Section } from "foundation-design-system";
9+} from "foundation-design-system";
5import Footer from "../components/Footer";
10import Footer from "../components/Footer";
6import Header from "../components/Header";
11import Header from "../components/Header";
7import BackgroundImage from "../components/BackgroundImage";
12import BackgroundImage from "../components/BackgroundImage";
@@ -20,8 +25,9 @@ export default function Blog({ posts, search }) {
20 <title>Blog • urbit.org</title>
25 <title>Blog • urbit.org</title>
21 {Meta(post)}
26 {Meta(post)}
22 </Head>
27 </Head>
28+ <IntraNav ourSite="https://urbit.org" search={search} />
23 <SingleColumn>
29 <SingleColumn>
24− <Header search={search} />
30+ <Header />
25 <Section narrow>
31 <Section narrow>
26 <div className="measure">
32 <div className="measure">
27 <h1 className="pb-16">Blog</h1>
33 <h1 className="pb-16">Blog</h1>
pages/blog/[slug].js+4−1
@@ -1,4 +1,5 @@
1import { useRouter } from "next/router";
1import { useRouter } from "next/router";
2+import { useState, useEffect } from "react";
2import {
3import {
3 getPostBySlug,
4 getPostBySlug,
4 getAllPosts,
5 getAllPosts,
@@ -14,6 +15,7 @@ import ErrorPage from "../404";
14import {
15import {
15 Container,
16 Container,
16 Markdown,
17 Markdown,
18+ IntraNav,
17 SingleColumn,
19 SingleColumn,
18 Section,
20 Section,
19} from "foundation-design-system";
21} from "foundation-design-system";
@@ -41,8 +43,9 @@ export default function Post({
41 <title>{post.title} • Blog • urbit.org</title>
43 <title>{post.title} • Blog • urbit.org</title>
42 {Meta(post)}
44 {Meta(post)}
43 </Head>
45 </Head>
46+ <IntraNav ourSite="https://urbit.org" search={search} />
44 <SingleColumn>
47 <SingleColumn>
45− <Header search={search} />
48+ <Header />
46 <Section short narrow>
49 <Section short narrow>
47 <h1>{post.title}</h1>
50 <h1>{post.title}</h1>
48 <h3 className=" mt-6">{post.description}</h3>
51 <h3 className=" mt-6">{post.description}</h3>
pages/events.js+8−2
@@ -3,7 +3,12 @@ import Link from "next/link";
3import { DateTime } from "luxon";
3import { DateTime } from "luxon";
4
4
5import Meta from "../components/Meta";
5import Meta from "../components/Meta";
6+import {
7+ Container,
8+ SingleColumn,
9+ Section,
10+ IntraNav,
6−import { Container, SingleColumn, Section } from "foundation-design-system";
11+} from "foundation-design-system";
7import Footer from "../components/Footer";
12import Footer from "../components/Footer";
8import Header from "../components/Header";
13import Header from "../components/Header";
9import EventPreview from "../components/EventPreview";
14import EventPreview from "../components/EventPreview";
@@ -53,8 +58,9 @@ export default function Events({ events, search }) {
53 <title>Events • urbit.org</title>
58 <title>Events • urbit.org</title>
54 {Meta(post)}
59 {Meta(post)}
55 </Head>
60 </Head>
61+ <IntraNav ourSite="https://urbit.org" search={search} />
56 <SingleColumn>
62 <SingleColumn>
57− <Header search={search} />
63+ <Header />
58 <Section short narrow>
64 <Section short narrow>
59 <div className="measure">
65 <div className="measure">
60 <h1 className="pb-16">Events</h1>
66 <h1 className="pb-16">Events</h1>
pages/events/[slug].js+3−1
@@ -14,6 +14,7 @@ import {
14 Markdown,
14 Markdown,
15 SingleColumn,
15 SingleColumn,
16 Section,
16 Section,
17+ IntraNav,
17} from "foundation-design-system";
18} from "foundation-design-system";
18import Header from "../../components/Header";
19import Header from "../../components/Header";
19import Footer from "../../components/Footer";
20import Footer from "../../components/Footer";
@@ -50,8 +51,9 @@ export default function Event({
50 <title>{event.title} • Events • urbit.org</title>
51 <title>{event.title} • Events • urbit.org</title>
51 {Meta(event)}
52 {Meta(event)}
52 </Head>
53 </Head>
54+ <IntraNav ourSite="https://urbit.org" search={search} />
53 <SingleColumn>
55 <SingleColumn>
54− <Header search={search} />
56+ <Header />
55 <Section narrow short>
57 <Section narrow short>
56 <h1>{event.title}</h1>
58 <h1>{event.title}</h1>
57 <h3 className="mt-6">{event.description}</h3>
59 <h3 className="mt-6">{event.description}</h3>
pages/grants.js+8−2
@@ -2,7 +2,12 @@ import Head from "next/head";
2import Meta from "../components/Meta";
2import Meta from "../components/Meta";
3import Link from "next/link";
3import Link from "next/link";
4import { useRouter } from "next/router";
4import { useRouter } from "next/router";
5+import {
6+ Container,
7+ SingleColumn,
8+ Section,
9+ IntraNav,
5−import { Container, SingleColumn, Section } from "foundation-design-system";
10+} from "foundation-design-system";
6import Footer from "../components/Footer";
11import Footer from "../components/Footer";
7import Header from "../components/Header";
12import Header from "../components/Header";
8import GrantPreview from "../components/GrantPreview";
13import GrantPreview from "../components/GrantPreview";
@@ -117,8 +122,9 @@ export default function Grants({ posts, categories, types, search }) {
117 "Contribute to the Urbit project while earning address space.",
122 "Contribute to the Urbit project while earning address space.",
118 })}
123 })}
119 </Head>
124 </Head>
125+ <IntraNav ourSite="https://urbit.org" search={search} />
120 <SingleColumn>
126 <SingleColumn>
121− <Header search={search} />
127+ <Header />
122 {
128 {
123 // Heading and Introduction
129 // Heading and Introduction
124 }
130 }
pages/grants/[slug].js+3−1
@@ -10,6 +10,7 @@ import {
10 Markdown,
10 Markdown,
11 SingleColumn,
11 SingleColumn,
12 Section,
12 Section,
13+ IntraNav,
13} from "foundation-design-system";
14} from "foundation-design-system";
14import Header from "../../components/Header";
15import Header from "../../components/Header";
15import Footer from "../../components/Footer";
16import Footer from "../../components/Footer";
@@ -48,8 +49,9 @@ export default function Grant({ post, markdown, search }) {
48 <title>{post.title} • Grants • urbit.org</title>
49 <title>{post.title} • Grants • urbit.org</title>
49 {Meta(post)}
50 {Meta(post)}
50 </Head>
51 </Head>
52+ <IntraNav ourSite="https://urbit.org" search={search} />
51 <SingleColumn>
53 <SingleColumn>
52− <Header search={search} />
54+ <Header />
53 <Section narrow short>
55 <Section narrow short>
54 <h1>{post.title}</h1>
56 <h1>{post.title}</h1>
55 {post.extra.assignee ? (
57 {post.extra.assignee ? (
pages/index.js+8−3
@@ -3,7 +3,12 @@ import Link from "next/link";
3import React from "react";
3import React from "react";
4import { DateTime } from "luxon";
4import { DateTime } from "luxon";
5
5
6+import {
7+ Container,
8+ Section,
9+ SingleColumn,
10+ IntraNav,
6−import { Container, Section, SingleColumn } from "foundation-design-system";
11+} from "foundation-design-system";
7import Header from "../components/Header";
12import Header from "../components/Header";
8import Footer from "../components/Footer";
13import Footer from "../components/Footer";
9import Contact from "../components/Contact";
14import Contact from "../components/Contact";
@@ -20,9 +25,9 @@ export default function Home({ posts, events, grantNumbers, search }) {
20 <Head>
25 <Head>
21 <title>urbit.org</title>
26 <title>urbit.org</title>
22 </Head>
27 </Head>
23− {/* {bannerElement} */}
28+ <IntraNav ourSite="https://urbit.org" search={search} />
24 <SingleColumn>
29 <SingleColumn>
25− <Header search={search} />
30+ <Header />
26 {
31 {
27 // Hero Statement
32 // Hero Statement
28 }
33 }
pages/media.js+8−2
@@ -1,7 +1,12 @@
1import Head from "next/head";
1import Head from "next/head";
2import Link from "next/link";
2import Link from "next/link";
3import Meta from "../components/Meta";
3import Meta from "../components/Meta";
4+import {
5+ Container,
6+ SingleColumn,
7+ Section,
8+ IntraNav,
4−import { Container, SingleColumn, Section } from "foundation-design-system";
9+} from "foundation-design-system";
5import Footer from "../components/Footer";
10import Footer from "../components/Footer";
6import Header from "../components/Header";
11import Header from "../components/Header";
7import { getAllPosts } from "../lib/lib";
12import { getAllPosts } from "../lib/lib";
@@ -73,8 +78,9 @@ export default function Media({ posts, search }) {
73 <title>Media • urbit.org</title>
78 <title>Media • urbit.org</title>
74 {Meta(post)}
79 {Meta(post)}
75 </Head>
80 </Head>
81+ <IntraNav ourSite="https://urbit.org" search={search} />
76 <SingleColumn>
82 <SingleColumn>
77− <Header search={search} />
83+ <Header />
78 <Section narrow>
84 <Section narrow>
79 <div className="measure">
85 <div className="measure">
80 <h1 className="pb-16">Media</h1>
86 <h1 className="pb-16">Media</h1>
pages/media/[slug].js+3−1
@@ -14,6 +14,7 @@ import {
14 Markdown,
14 Markdown,
15 SingleColumn,
15 SingleColumn,
16 Section,
16 Section,
17+ IntraNav,
17} from "foundation-design-system";
18} from "foundation-design-system";
18import Header from "../../components/Header";
19import Header from "../../components/Header";
19import Footer from "../../components/Footer";
20import Footer from "../../components/Footer";
@@ -31,8 +32,9 @@ export default function MediaPage({ post, markdown, search }) {
31 <title>{post.title} • Media • urbit.org</title>
32 <title>{post.title} • Media • urbit.org</title>
32 {Meta(post)}
33 {Meta(post)}
33 </Head>
34 </Head>
35+ <IntraNav ourSite="https://urbit.org" search={search} />
34 <SingleColumn>
36 <SingleColumn>
35− <Header search={search} />
37+ <Header />
36 <Section narrow short>
38 <Section narrow short>
37 <h1>{post.title}</h1>
39 <h1>{post.title}</h1>
38 {post.extra.author ? (
40 {post.extra.author ? (
pages/updates.js+8−2
@@ -1,7 +1,12 @@
1import Head from "next/head";
1import Head from "next/head";
2import Meta from "../components/Meta";
2import Meta from "../components/Meta";
3import Link from "next/link";
3import Link from "next/link";
4+import {
5+ Container,
6+ SingleColumn,
7+ Section,
8+ IntraNav,
4−import { Container, SingleColumn, Section } from "foundation-design-system";
9+} from "foundation-design-system";
5import Footer from "../components/Footer";
10import Footer from "../components/Footer";
6import Header from "../components/Header";
11import Header from "../components/Header";
7import { getAllPosts, formatDate, generateDisplayDate } from "../lib/lib";
12import { getAllPosts, formatDate, generateDisplayDate } from "../lib/lib";
@@ -17,8 +22,9 @@ export default function Updates({ posts, search }) {
17 <title>Updates • urbit.org</title>
22 <title>Updates • urbit.org</title>
18 {Meta(post)}
23 {Meta(post)}
19 </Head>
24 </Head>
25+ <IntraNav ourSite="https://urbit.org" search={search} />
20 <SingleColumn>
26 <SingleColumn>
21− <Header search={search} />
27+ <Header />
22 <Section narrow>
28 <Section narrow>
23 <div className="measure">
29 <div className="measure">
24 <h1 className="pb-16">Updates</h1>
30 <h1 className="pb-16">Updates</h1>
pages/updates/[slug].js+3−1
@@ -15,6 +15,7 @@ import {
15 Markdown,
15 Markdown,
16 SingleColumn,
16 SingleColumn,
17 Section,
17 Section,
18+ IntraNav,
18} from "foundation-design-system";
19} from "foundation-design-system";
19import Header from "../../components/Header";
20import Header from "../../components/Header";
20import Footer from "../../components/Footer";
21import Footer from "../../components/Footer";
@@ -32,8 +33,9 @@ export default function Post({ post, markdown, search }) {
32 <title>{post.title} • Updates • urbit.org</title>
33 <title>{post.title} • Updates • urbit.org</title>
33 {Meta(post)}
34 {Meta(post)}
34 </Head>
35 </Head>
36+ <IntraNav ourSite="https://urbit.org" search={search} />
35 <SingleColumn>
37 <SingleColumn>
36− <Header search={search} />
38+ <Header />
37 <Section short narrow>
39 <Section short narrow>
38 <h1>{post.title}</h1>
40 <h1>{post.title}</h1>
39 {post.author ? (
41 {post.author ? (