on master help sign in
hide rsvp buttom on past events
f3f7df4Gavin Atkinson
components/Contact.js+3−3
@@ -18,7 +18,7 @@ export default function Contact({ emphasize }) {
18 fillRule="evenodd"
18 fillRule="evenodd"
19 clipRule="evenodd"
19 clipRule="evenodd"
20 d="M3.2 1.6C3.2 0.716344 3.91634 0 4.8 0H11.3615L14.9333 2.38124V12.2667C14.9333 13.1503 14.217 13.8667 13.3333 13.8667H12.8V14.4C12.8 15.2837 12.0837 16 11.2 16H2.66667C1.78301 16 1.06667 15.2837 1.06667 14.4V3.73333C1.06667 2.84968 1.78301 2.13333 2.66667 2.13333H3.2V1.6ZM3.2 3.2H2.66667C2.37211 3.2 2.13333 3.43878 2.13333 3.73333V14.4C2.13333 14.6946 2.37211 14.9333 2.66667 14.9333H11.2C11.4946 14.9333 11.7333 14.6946 11.7333 14.4V13.8667H4.8C3.91634 13.8667 3.2 13.1503 3.2 12.2667V3.2Z"
20 d="M3.2 1.6C3.2 0.716344 3.91634 0 4.8 0H11.3615L14.9333 2.38124V12.2667C14.9333 13.1503 14.217 13.8667 13.3333 13.8667H12.8V14.4C12.8 15.2837 12.0837 16 11.2 16H2.66667C1.78301 16 1.06667 15.2837 1.06667 14.4V3.73333C1.06667 2.84968 1.78301 2.13333 2.66667 2.13333H3.2V1.6ZM3.2 3.2H2.66667C2.37211 3.2 2.13333 3.43878 2.13333 3.73333V14.4C2.13333 14.6946 2.37211 14.9333 2.66667 14.9333H11.2C11.4946 14.9333 11.7333 14.6946 11.7333 14.4V13.8667H4.8C3.91634 13.8667 3.2 13.1503 3.2 12.2667V3.2Z"
21− fill="#32302D"
21+ fill="#666666"
22 />
22 />
23 </svg>
23 </svg>
24 ) : copyStatus === "copied" ? (
24 ) : copyStatus === "copied" ? (
@@ -33,7 +33,7 @@ export default function Contact({ emphasize }) {
33 fillRule="evenodd"
33 fillRule="evenodd"
34 clipRule="evenodd"
34 clipRule="evenodd"
35 d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8ZM7.54325 11.4247L12.1498 5.66647L11.3169 5.00013L7.39013 9.90859L4.60812 7.59025L3.92526 8.40969L7.54325 11.4247Z"
35 d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8ZM7.54325 11.4247L12.1498 5.66647L11.3169 5.00013L7.39013 9.90859L4.60812 7.59025L3.92526 8.40969L7.54325 11.4247Z"
36− fill="#32302D"
36+ fill="#666666"
37 />
37 />
38 </svg>
38 </svg>
39 ) : (
39 ) : (
@@ -48,7 +48,7 @@ export default function Contact({ emphasize }) {
48 fillRule="evenodd"
48 fillRule="evenodd"
49 clipRule="evenodd"
49 clipRule="evenodd"
50 d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8ZM10.8229 11.5772L8.00004 8.75429L5.17716 11.5772L4.42292 10.8229L7.24579 8.00004L4.42292 5.17716L5.17716 4.42292L8.00004 7.24579L10.8229 4.42292L11.5772 5.17716L8.75429 8.00004L11.5772 10.8229L10.8229 11.5772Z"
50 d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8ZM10.8229 11.5772L8.00004 8.75429L5.17716 11.5772L4.42292 10.8229L7.24579 8.00004L4.42292 5.17716L5.17716 4.42292L8.00004 7.24579L10.8229 4.42292L11.5772 5.17716L8.75429 8.00004L11.5772 10.8229L10.8229 11.5772Z"
51− fill="#32302D"
51+ fill="#666666"
52 />
52 />
53 </svg>
53 </svg>
54 );
54 );
components/EventPreview.js+11−1
@@ -1,6 +1,6 @@
1import Link from "next/link";
1import Link from "next/link";
2
2
3−export default function EventPreview({ event, className, title }) {
3+export default function EventPreview({ event, className, title, rsvp }) {
4 // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
4 // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
5 const grayText = event.extra?.dark ? "text-midWhite" : "text-gray";
5 const grayText = event.extra?.dark ? "text-midWhite" : "text-gray";
6 const blackText = event.extra?.dark ? "text-white" : "text-black";
6 const blackText = event.extra?.dark ? "text-white" : "text-black";
@@ -25,6 +25,16 @@ export default function EventPreview({ event, className, title }) {
25 {event.extra.guests}
25 {event.extra.guests}
26 </p>
26 </p>
27 </div>
27 </div>
28+ {rsvp && event.extra.registration_url && event.extra.pinned ? (
29+ <div className="absolute right-0 bottom-0 p-4">
30+ <a
31+ className="button-sm bg-green text-white"
32+ href={event.extra.registration_url}
33+ >
34+ RSVP
35+ </a>
36+ </div>
37+ ) : null}
28 </div>
38 </div>
29 </Link>
39 </Link>
30 </div>
40 </div>
components/Header.js+3−2
@@ -82,9 +82,10 @@ export default function Header(props) {
82 e.stopPropagation();
82 e.stopPropagation();
83 props.search.toggleSearch(e);
83 props.search.toggleSearch(e);
84 }}
84 }}
85− className="button-sm bg-wall text-gray"
85+ className="bg-wall text-gray flex px-4 py-1 rounded-lg type-ui"
86 >
86 >
87+ <div>Search</div>
87− Search<div className="ml-4 text-lightGray">⌘K</div>
88+ <div className="ml-4 text-lightGray">⌘K</div>
88 </button>
89 </button>
89 </nav>
90 </nav>
90
91
pages/events/[slug].js+14−2
@@ -36,6 +36,7 @@ export default function Event({
36 <Header search={search} />
36 <Header search={search} />
37 <Section narrow short>
37 <Section narrow short>
38 <h1>{post.title}</h1>
38 <h1>{post.title}</h1>
39+
39 {post.extra.author ? (
40 {post.extra.author ? (
40 <div className="type-ui text-gray mt-4 md:mt-8 lg:mt-10">
41 <div className="type-ui text-gray mt-4 md:mt-8 lg:mt-10">
41 {post.extra.author}
42 {post.extra.author}
@@ -44,8 +45,19 @@ export default function Event({
44 {post.extra.ship ? (
45 {post.extra.ship ? (
45 <div className="type-ui text-gray font-mono">{post.extra.ship}</div>
46 <div className="type-ui text-gray font-mono">{post.extra.ship}</div>
46 ) : null}
47 ) : null}
48+
47− <div className="type-ui text-gray mt-16">
49+ <div className="mt-16">
50+ <p className="type-ui text-gray">
48− {formatDate(new Date(post.date))}
51+ {formatDate(new Date(post.date))} {", " + post.extra.time}
52+ </p>
53+ {post.extra.registration_url && post.extra.pinned ? (
54+ <a
55+ className="button-sm bg-green text-white flex-0 mt-4"
56+ href={post.extra.registration_url}
57+ >
58+ RSVP
59+ </a>
60+ ) : null}
49 </div>
61 </div>
50 </Section>
62 </Section>
51 <Section short wide>
63 <Section short wide>
pages/index.js+47−78
@@ -1,5 +1,4 @@
1import Head from "next/head";
1import Head from "next/head";
2−import Meta from "../components/Meta";
3import Link from "next/link";
2import Link from "next/link";
4import React, { useState, useEffect } from "react";
3import React, { useState, useEffect } from "react";
5import Container from "../components/Container";
4import Container from "../components/Container";
@@ -52,7 +51,6 @@ export default function Home({ posts, events, openGrantsCount, search }) {
52 <Container>
51 <Container>
53 <Head>
52 <Head>
54 <title>urbit.org</title>
53 <title>urbit.org</title>
55− {Meta()}
56 </Head>
54 </Head>
57 <SingleColumn>
55 <SingleColumn>
58 <Header search={search} />
56 <Header search={search} />
@@ -185,88 +183,59 @@ export default function Home({ posts, events, openGrantsCount, search }) {
185 </Section>
183 </Section>
186
184
187 {
185 {
188− // Blog and Events Combo Section
186+ // Blog Posts
189 }
187 }
190 <Section narrow>
188 <Section narrow>
191 <div className="flex items-center measure pb-12">
189 <div className="flex items-center measure pb-12">
192− <button
193− onClick={() => setTab(0)}
194− className={`tab-button-lg mr-6 ${
195− tab === 0 ? "text-black" : "text-gray"
196− }`}
197− >
198− Blog
190+ <h2>Blog</h2>
199− </button>
191+ </div>
200− <button
192+
201− onClick={() => setTab(1)}
193+ <div className="flex flex-wrap">
202− className={`tab-button-lg ${
194+ <PostPreview
203− tab === 1 ? "text-black" : "text-gray"
195+ post={posts[0]}
204− }`}
196+ className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
205− >
197+ key={posts[0].slug}
206− Events
198+ />
199+ <PostPreview
200+ post={posts[1]}
201+ className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
202+ key={posts[1].slug}
203+ />
204+ </div>
205+ <Link href="/blog">
206+ <button className="button-lg type-ui text-white bg-green">
207+ See More
207 </button>
208 </button>
209+ </Link>
210+ </Section>
211+
212+ {
213+ // Events Posts
214+ }
215+ <Section narrow>
216+ <div className="flex items-center measure pb-12">
217+ <h2>Events</h2>
208 </div>
218 </div>
209
219
210− <TabCarousel index={tab}>
211− <div className="flex flex-wrap">
220+ <div className="flex flex-wrap">
212− <PostPreview
221+ <EventPreview
213− post={posts[0]}
222+ rsvp
214− className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
215− key={posts[0].slug}
216− />
217− <PostPreview
218− post={posts[1]}
219− className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
220− key={posts[1].slug}
221− />
222− <PostPreview
223− post={posts[2]}
224− className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
225− key={posts[2].slug}
226− />
227− <PostPreview
228− post={posts[3]}
229− className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
230− key={posts[3].slug}
231− />
232− <div>
233− <Link href="/blog">
234− <button className="button-lg type-ui text-white bg-ultraDeepWall">
235− Read More
236− </button>
237− </Link>
238− </div>
239− </div>
240− <div className="flex flex-wrap">
241− <EventPreview
242− event={events[0]}
223+ event={events[0]}
243− className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
224+ className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
244− key={events[0].slug}
225+ key={events[0].slug}
245− />
226+ />
246− <EventPreview
227+ <EventPreview
247− event={events[1]}
228+ rsvp
248− className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
249− key={events[1].slug}
250− />
251− <EventPreview
252− event={events[2]}
229+ event={events[1]}
253− className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
254− key={events[2].slug}
255− />
256− <EventPreview
257− event={events[3]}
258− className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
230+ className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
259− key={events[3].slug}
231+ key={events[1].slug}
260− />
232+ />
261− <div>
233+ </div>
262− <Link href="/events">
234+ <Link href="/docs">
263− <button className="button-lg type-ui text-white bg-ultraDeepWall">
235+ <button className="button-lg type-ui text-white bg-ultraDeepWall">
264− More Events
236+ More Events
265− </button>
237+ </button>
266− </Link>
238+ </Link>
267− </div>
268− </div>
269− </TabCarousel>
270 </Section>
239 </Section>
271
240
272 {
241 {
styles/globals.css+1−1
@@ -72,7 +72,7 @@ button {
72}
72}
73
73
74.button-sm {
74.button-sm {
75− @apply flex px-4 py-1 rounded-lg type-ui;
75+ @apply table px-4 py-1 rounded-lg type-ui;
76}
76}
77
77
78.button-lg {
78.button-lg {