|
|
|
@ -1,3 +1,6 @@ |
|
|
|
|
import { ParsedUrlQuery } from "querystring"; |
|
|
|
|
|
|
|
|
|
import { GetStaticProps } from "next"; |
|
|
|
|
import React from "react"; |
|
|
|
|
|
|
|
|
|
import { ConnectWithUs } from "@/components/ConnectWithUs"; |
|
|
|
@ -7,27 +10,19 @@ import { EventDescriptionCard } from "@/components/EventDescriptionCard"; |
|
|
|
|
import { Image } from "@/components/Image"; |
|
|
|
|
import { NewsCard } from "@/components/NewsCard"; |
|
|
|
|
import { SocialLinks } from "@/components/SocialLinks"; |
|
|
|
|
import { Event, getUpcomingEvents } from "@/lib/events"; |
|
|
|
|
|
|
|
|
|
import AltTab, { |
|
|
|
|
metadata as altTabEventMetadata, |
|
|
|
|
} from "../content/playground/alt-tab.event.mdx"; |
|
|
|
|
import OOTBReact, { |
|
|
|
|
metadata as OOTBReactEventMetadata, |
|
|
|
|
} from "../content/playground/ootb-react.event.mdx"; |
|
|
|
|
import UnavailableContent, { |
|
|
|
|
metadata as unavailableMetadata, |
|
|
|
|
} from "../content/playground/unavailable.news.mdx"; |
|
|
|
|
|
|
|
|
|
import styles from "./index.module.css"; |
|
|
|
|
|
|
|
|
|
// temporary event and news imports
|
|
|
|
|
|
|
|
|
|
export default function Home() { |
|
|
|
|
const events = [ |
|
|
|
|
{ Content: OOTBReact, metadata: OOTBReactEventMetadata }, |
|
|
|
|
{ Content: AltTab, metadata: altTabEventMetadata }, |
|
|
|
|
]; |
|
|
|
|
interface Props { |
|
|
|
|
events: Event[]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export default function Home(props: Props) { |
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<DefaultLayout> |
|
|
|
@ -54,18 +49,31 @@ export default function Home() { |
|
|
|
|
</DefaultLayout> |
|
|
|
|
<div className={styles.cardsBackground}> |
|
|
|
|
<div className={styles.cards}> |
|
|
|
|
{/* TODO: add links to past events and past news */} |
|
|
|
|
{/* TODO: add links to past/upcoming events and past news */} |
|
|
|
|
<section className={styles.events}> |
|
|
|
|
<h1 className={styles.cardsHeading}>Upcoming Events</h1> |
|
|
|
|
<p className={styles.cardsDescription}>See past events here</p> |
|
|
|
|
<hr className={styles.cardsDividingLine} /> |
|
|
|
|
<div className={styles.eventCards}> |
|
|
|
|
{events.map(({ metadata }) => ( |
|
|
|
|
<EventDescriptionCard |
|
|
|
|
{...metadata} |
|
|
|
|
key={metadata.name + metadata.date.toString()} |
|
|
|
|
/> |
|
|
|
|
))} |
|
|
|
|
{props.events.length > 0 ? ( |
|
|
|
|
props.events |
|
|
|
|
.slice(0, 2) |
|
|
|
|
.map((event) => ( |
|
|
|
|
<EventDescriptionCard |
|
|
|
|
{...event.metadata} |
|
|
|
|
date={new Date(event.metadata.date)} |
|
|
|
|
key={event.metadata.name + event.metadata.date.toString()} |
|
|
|
|
/> |
|
|
|
|
)) |
|
|
|
|
) : ( |
|
|
|
|
<p> |
|
|
|
|
There are no upcoming events right now. Please check back |
|
|
|
|
later! |
|
|
|
|
</p> |
|
|
|
|
)} |
|
|
|
|
{props.events.length > 2 ? ( |
|
|
|
|
<p>See more upcoming events here</p> |
|
|
|
|
) : null} |
|
|
|
|
</div> |
|
|
|
|
</section> |
|
|
|
|
<section className={styles.news} id="news"> |
|
|
|
@ -92,3 +100,10 @@ export default function Home() { |
|
|
|
|
Home.Layout = function HomeLayout(props: { children: React.ReactNode }) { |
|
|
|
|
return <div className={styles.page}>{props.children}</div>; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
type Params = ParsedUrlQuery; |
|
|
|
|
|
|
|
|
|
export const getStaticProps: GetStaticProps<Props, Params> = async () => { |
|
|
|
|
const events = await getUpcomingEvents(); |
|
|
|
|
return { props: { events } }; |
|
|
|
|
}; |
|
|
|
|