2021-05-13 18:47:40 -04:00
|
|
|
import React, { useState } from "react";
|
2021-04-26 19:16:55 -04:00
|
|
|
import styles from "./playground.module.css";
|
|
|
|
|
2021-05-12 00:34:49 -04:00
|
|
|
import AfterHoursContent, {
|
|
|
|
metadata as afterHoursMetadata,
|
|
|
|
} from "../content/playground/after-hours.event.mdx";
|
2021-05-24 02:00:47 -04:00
|
|
|
import OOTBReact, {
|
|
|
|
metadata as OOTBReactEventMetadata,
|
|
|
|
} from "../content/playground/ootb-react.event.mdx";
|
|
|
|
import AltTab, {
|
|
|
|
metadata as altTabEventMetadata,
|
|
|
|
} from "../content/playground/alt-tab.event.mdx";
|
|
|
|
|
2021-05-31 02:26:27 -04:00
|
|
|
import ReadAll, {
|
|
|
|
metadata as readAllOrganizedContentMetadata,
|
|
|
|
} from "../content/playground/constitution/read-all.organized-content.mdx";
|
|
|
|
import Name, {
|
|
|
|
metadata as nameOrganizedContentMetadata,
|
|
|
|
} from "../content/playground/constitution/name.organized-content.mdx";
|
|
|
|
import Purpose, {
|
|
|
|
metadata as purposeOrganizedContentMetadata,
|
|
|
|
} from "../content/playground/constitution/purpose.organized-content.mdx";
|
|
|
|
import Membership, {
|
|
|
|
metadata as membershipOrganizedContentMetadata,
|
|
|
|
} from "../content/playground/constitution/membership.organized-content.mdx";
|
|
|
|
import Officers, {
|
|
|
|
metadata as officersOrganizedContentMetadata,
|
|
|
|
} from "../content/playground/constitution/officers.organized-content.mdx";
|
|
|
|
import Duties, {
|
|
|
|
metadata as dutiesOrganizedContentMetadata,
|
|
|
|
} from "../content/playground/constitution/duties-of-officers.organized-content.mdx";
|
|
|
|
import ExecutiveCouncil, {
|
|
|
|
metadata as executiveCouncilOrganizedContentMetadata,
|
|
|
|
} from "../content/playground/constitution/executive-council.organized-content.mdx";
|
|
|
|
|
2021-05-14 04:03:26 -04:00
|
|
|
import UnavailableContent, {
|
|
|
|
metadata as unavailableMetadata,
|
|
|
|
} from "../content/playground/unavailable.news.mdx";
|
2021-05-24 05:21:34 -04:00
|
|
|
import { metadata as dogeMetadata } from "../content/playground/doge.team-member.mdx";
|
|
|
|
import CodeyInfo, {
|
|
|
|
metadata as codeyMetadata,
|
|
|
|
} from "../content/playground/codey.team-member.mdx";
|
2021-05-12 00:34:49 -04:00
|
|
|
|
|
|
|
import { MiniEventCard } from "./MiniEventCard";
|
2021-05-14 04:03:26 -04:00
|
|
|
import { NewsCard } from "./NewsCard";
|
2021-05-24 02:00:47 -04:00
|
|
|
import { EventCard } from "./EventCard";
|
2021-05-23 18:56:49 -04:00
|
|
|
import { EventDescriptionCard } from "./EventDescriptionCard";
|
|
|
|
import { TeamMember } from "./TeamMember";
|
2021-05-24 05:21:34 -04:00
|
|
|
import { TeamMemberCard } from "./TeamMemberCard";
|
2021-05-13 18:47:40 -04:00
|
|
|
import { OrganizedContent, LinkProps } from "./OrganizedContent";
|
2021-05-12 00:34:49 -04:00
|
|
|
|
2021-05-24 03:41:50 -04:00
|
|
|
const events = [
|
|
|
|
{ Content: OOTBReact, metadata: OOTBReactEventMetadata },
|
2021-05-24 04:04:02 -04:00
|
|
|
{ Content: AfterHoursContent, metadata: afterHoursMetadata },
|
2021-05-24 03:41:50 -04:00
|
|
|
{ Content: AltTab, metadata: altTabEventMetadata },
|
|
|
|
];
|
2021-05-12 00:34:49 -04:00
|
|
|
|
2021-05-31 02:26:27 -04:00
|
|
|
const constitution = [
|
2021-05-31 02:45:29 -04:00
|
|
|
{ content: <ReadAll />, ...readAllOrganizedContentMetadata },
|
|
|
|
{ content: <Name />, ...nameOrganizedContentMetadata },
|
|
|
|
{ content: <Purpose />, ...purposeOrganizedContentMetadata },
|
|
|
|
{ content: <Membership />, ...membershipOrganizedContentMetadata },
|
|
|
|
{ content: <Officers />, ...officersOrganizedContentMetadata },
|
|
|
|
{ content: <Duties />, ...dutiesOrganizedContentMetadata },
|
2021-05-31 02:26:27 -04:00
|
|
|
{
|
2021-05-31 02:45:29 -04:00
|
|
|
content: <ExecutiveCouncil />,
|
|
|
|
...executiveCouncilOrganizedContentMetadata,
|
2021-05-31 02:26:27 -04:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2021-05-12 00:34:49 -04:00
|
|
|
export function MiniEventCardDemo() {
|
2021-04-26 19:16:55 -04:00
|
|
|
return (
|
2021-05-12 00:34:49 -04:00
|
|
|
<div className={styles.miniEventCardDemo}>
|
2021-05-24 03:41:50 -04:00
|
|
|
{events.map(({ Content, metadata }) => (
|
|
|
|
<MiniEventCard
|
|
|
|
{...metadata}
|
|
|
|
description={<Content />}
|
|
|
|
key={metadata.name + metadata.date.toString()}
|
|
|
|
/>
|
|
|
|
))}
|
2021-05-12 00:34:49 -04:00
|
|
|
</div>
|
2021-04-26 19:16:55 -04:00
|
|
|
);
|
|
|
|
}
|
2021-05-12 00:34:49 -04:00
|
|
|
|
2021-05-14 04:03:26 -04:00
|
|
|
export function NewsCardDemo() {
|
|
|
|
return (
|
2021-05-23 18:56:49 -04:00
|
|
|
<div className={styles.newsDemo}>
|
2021-05-14 04:03:26 -04:00
|
|
|
<div className={styles.newsTitle}>News</div>
|
|
|
|
<div className={styles.newsDesc}>
|
|
|
|
Updates from our execs
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
</div>
|
|
|
|
<hr className={styles.newsHr} />
|
|
|
|
<NewsCard {...unavailableMetadata}>
|
|
|
|
<UnavailableContent />
|
|
|
|
</NewsCard>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2021-05-12 00:34:49 -04:00
|
|
|
|
2021-05-16 03:22:06 -04:00
|
|
|
export function EventDescriptionCardDemo() {
|
2021-04-26 19:16:55 -04:00
|
|
|
return (
|
2021-05-16 03:22:06 -04:00
|
|
|
<div className={styles.eventDescriptionCardDemo}>
|
2021-05-24 03:41:50 -04:00
|
|
|
{events.map(({ metadata }) => (
|
|
|
|
<EventDescriptionCard
|
|
|
|
{...metadata}
|
|
|
|
key={metadata.name + metadata.date.toString()}
|
|
|
|
>
|
|
|
|
{metadata.short}
|
|
|
|
</EventDescriptionCard>
|
|
|
|
))}
|
2021-05-16 03:22:06 -04:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2021-05-23 18:56:49 -04:00
|
|
|
|
2021-05-24 02:00:47 -04:00
|
|
|
export function EventCardDemo() {
|
|
|
|
return (
|
|
|
|
<>
|
2021-05-24 03:41:50 -04:00
|
|
|
{events.map(({ Content, metadata }) => (
|
|
|
|
<EventCard
|
|
|
|
{...metadata}
|
|
|
|
key={metadata.name + metadata.date.toDateString()}
|
|
|
|
>
|
2021-05-24 02:00:47 -04:00
|
|
|
<Content />
|
|
|
|
</EventCard>
|
|
|
|
))}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-05-23 18:56:49 -04:00
|
|
|
export function TeamMemberDemo() {
|
|
|
|
return (
|
|
|
|
<div className={styles.teamMemberDemo}>
|
|
|
|
<div className={styles.teamMemberHeader}>
|
|
|
|
<h1 className={styles.committee}>Programme Committee</h1>
|
|
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
<div className={styles.teamMembers}>
|
2021-05-24 05:21:34 -04:00
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
|
|
|
<TeamMember {...dogeMetadata} />
|
2021-05-23 18:56:49 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2021-05-24 05:21:34 -04:00
|
|
|
|
|
|
|
export function TeamMemberCardDemo() {
|
|
|
|
return (
|
|
|
|
<div className={styles.teamMemberCardDemo}>
|
|
|
|
<TeamMemberCard {...codeyMetadata}>
|
|
|
|
<CodeyInfo />
|
|
|
|
</TeamMemberCard>
|
2021-05-12 00:34:49 -04:00
|
|
|
</div>
|
2021-05-24 17:49:44 -04:00
|
|
|
);
|
2021-05-13 18:47:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export function OrganizedContentDemo() {
|
2021-05-31 02:45:29 -04:00
|
|
|
const sections = constitution;
|
2021-05-13 18:47:40 -04:00
|
|
|
|
|
|
|
const [index, setIndex] = useState(0);
|
|
|
|
|
2021-05-31 01:12:03 -04:00
|
|
|
function FakeLink({ className, url, children }: LinkProps) {
|
2021-05-13 18:47:40 -04:00
|
|
|
return (
|
|
|
|
<div
|
2021-05-31 01:12:03 -04:00
|
|
|
className={className}
|
2021-05-13 18:47:40 -04:00
|
|
|
onClick={() => {
|
|
|
|
const target = sections.findIndex((section) => section.url === url);
|
|
|
|
|
|
|
|
if (target >= 0) {
|
|
|
|
setIndex(target);
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<OrganizedContent headings={sections} currentIndex={index} link={FakeLink}>
|
2021-05-31 02:26:27 -04:00
|
|
|
{sections[index].content}
|
2021-05-13 18:47:40 -04:00
|
|
|
</OrganizedContent>
|
2021-04-26 19:16:55 -04:00
|
|
|
);
|
|
|
|
}
|