Skip to content

Commit

Permalink
added in the schedule
Browse files Browse the repository at this point in the history
added in the schedule for covhack2020
  • Loading branch information
Tom committed Jan 10, 2020
1 parent 48b8b99 commit 0aa6a44
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 6 deletions.
7 changes: 7 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ module.exports = {
path: `${__dirname}/src/img`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `schedule`,
path: `${__dirname}/src/collections/schedule`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
Expand Down
28 changes: 23 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/collections/schedule/saturday.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
type: schedule
title: Saturday
listOrder: 1
---

<style>
table{
width:100%;
}
</style>

| Time | Activity |
|-------|-----------------------|
| 10:00 | Doors Open |
| 11:00 | Opening Presentations |
| 12:00 | Hacking Starts! |
| 13:00 | Lunch |
| 14:00 | Workshops Start |
| 19:00 | Dinner |
| 20:00 | Code in the Dark |
| 21:00 | Code Golf |
| 22:00 | Werewolf |
22 changes: 22 additions & 0 deletions src/collections/schedule/sunday.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
type: schedule
title: Sunday
listOrder: 2
---

<style>
table{
width:100%;
}
</style>


| Time | Activity |
|-------|-----------------------------|
| 7:00 | Breakfast |
| 12:00 | Hacking Ends |
| 13:00 | Lunch |
| 14:00 | Presentations |
| 16:00 | Judging |
| 16:30 | Awards and Closing Ceremony |
| 17:00 | Closing |
25 changes: 25 additions & 0 deletions src/components/Schedule/Schedule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'

import { Row, Col, Card, CardBody, CardTitle, CardText } from 'reactstrap'

export const Schedule = props => (
<Row className="row-eq-height">
{props.schedule
.sort((a, b) => a.listOrder - b.listOrder)
.map(schedule => (
<Col md="12" lg="6" key={Schedule.id} className="mb-3">
<Card className="shadow-sm bg-white h-100">
<CardBody>
<CardTitle>
<h4>{schedule.title}</h4>
</CardTitle>

<CardText>
<div dangerouslySetInnerHTML={{ __html: schedule.html }} />
</CardText>
</CardBody>
</Card>
</Col>
))}
</Row>
)
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './Header/Header'
export * from './Layout/Layout'
export * from './Map/Map'
export * from './Sponsors/Sponsors'
export * from './Schedule/Schedule'
export * from './HowToFindUs/HowToFindUs'
export * from './Countdown/Countdown'
export * from './FAQ/FAQ'
Expand Down
31 changes: 30 additions & 1 deletion src/templates/index-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Map,
Sponsors,
Layout,
Schedule,
HowToFindUs,
FAQ,
Team,
Expand All @@ -17,13 +18,16 @@ import {
} from '../components'

export default function IndexPage({ data, pageContext: { font } }) {
const { markdownRemark, howToFindUs, faq, team, file, sponsor } = data
const { markdownRemark, schedule, howToFindUs, faq, team, file, sponsor } = data
const { frontmatter, html } = markdownRemark

useEffect(() => {
if (font) document.body.style.fontFamily = font
})

const scheduleData = schedule.edges
.map(e => ({ ...e.node, ...e.node.frontmatter }))
.filter(e => e.type === 'schedule')
const faqData = faq.edges
.map(e => ({ ...e.node, ...e.node.frontmatter }))
.filter(e => e.type === 'faq')
Expand Down Expand Up @@ -111,6 +115,17 @@ export default function IndexPage({ data, pageContext: { font } }) {

<Sponsors sponsors={sponsorData} className="mb-10" />

<Container style={{ marginTop: '3em', marginBottom: '3em' }}>
<h2 style={{ marginTop: '1.5rem' }}>
<Emoji value={'🕒'} /> Schedule
</h2>
<p>
This is subject to change, but our planned schedule is as follows:
</p>

<Schedule schedule={scheduleData} style={{ marginBottom: '2em' }} />
</Container>

<Container style={{ marginTop: '3em', marginBottom: '3em' }}>
<h2 style={{ marginTop: '1.5rem' }}>
<Emoji value={'📍'} /> How To Find Us
Expand Down Expand Up @@ -171,6 +186,20 @@ export const pageQuery = graphql`
}
}
schedule: allMarkdownRemark(filter: { frontmatter: { type: { eq: "schedule" } } }) {
edges {
node {
id
html
frontmatter {
title
type
listOrder
}
}
}
}
faq: allMarkdownRemark(filter: { frontmatter: { type: { eq: "faq" } } }) {
edges {
node {
Expand Down

0 comments on commit 0aa6a44

Please sign in to comment.