Skip to content

sort of pretty schedule #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ module.exports = {
name: `Home`,
url: `/`,
},
{
name: 'Schedule',
url: 'https://cfp.campjs.org/campjs-xi/schedule/',
},
{
name: `Code of Conduct`,
url: `/code-of-conduct`,
Expand Down
4 changes: 4 additions & 0 deletions src/pages/DayName.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as React from "react";

const dayFormatter = new Intl.DateTimeFormat("en-AU", { weekday: "long" });
export const DayName = ({ date }) => <>{dayFormatter.format(date)}</>;
7 changes: 7 additions & 0 deletions src/pages/Presenters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from "react";

const formatter = new Intl.ListFormat("en", {
style: "long",
type: "conjunction"
});
export const Presenters = ({ persons }) => (<>{formatter.format(persons.map((p) => p.public_name))}</>);
65 changes: 65 additions & 0 deletions src/pages/schedule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import * as React from "react";
import Layout from "../components/layout";
import Heading from "../components/heading";

import schedule from "../../schedule.json";
import { DayName } from "./DayName";
import { Presenters } from "./Presenters";

const paragraphStyles = {
marginBottom: 48
};
const middleParagraphStyles = {
marginBottom: 24
};

const Talk = ({ title, abstract, room, persons, start, duration, url }) => (
<div
style={{
marginBottom: "3vh",
display: "flex",
flexDirection: "row",
justifyContent: "flex-start",
gap: "1vh 1vw"
}}
>
<div style={{ flexShrink: 1 }}>
<div>{start}</div>
<div style={{ color: '#888', fontSize: '0.5rem' }}>...</div>
<div style={{ color: '#888', fontSize: '0.8rem' }}>{duration}</div>
</div>
<div style={{ flexGrow: 1, marginBottom: "1vh" }}>
<h4 style={{ marginTop: 0, marginBottom: "1vh" }}><a href={url}>{title}</a></h4>
<p style={{ marginBottom: "1vh" }}>
<Presenters persons={persons} />
</p>
<p style={{ textTransform: 'uppercase', fontSize: '0.8rem', color: '#888' }}>{room}</p>
</div>
</div>
);

const days = schedule.schedule.conference.days.map((day) => {
return (
<div style={{ marginBottom: "5vh" }}>
<h2 style={{ borderBottom: "1px solid #eeeeee" }}>
{<DayName date={new Date(day.date)} />}
</h2>

{Object.entries(day.rooms).map(([name, room]) => (
<>{room.map(Talk)}</>
))}
</div>
);
});

const Page = ({ location }) => {
return (
<Layout location={location}>
<Heading>🏕 Schedule</Heading>

{days}
</Layout>
);
};

export default Page;