Skip to content
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

Exercise 7 - Display Speaker Data #10

Open
wants to merge 8 commits into
base: 06-add-speaker-data-to-graphql
Choose a base branch
from
1 change: 1 addition & 0 deletions site/src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function Header({ siteTitle }) {
const NavLinks = [
{ href: "/", name: "Home" },
{ href: "/tickets", name: "Tickets" },
{ href: "/#schedule", name: "Schedule" },
];

return (
Expand Down
32 changes: 27 additions & 5 deletions site/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { useStaticQuery } from "gatsby";
import React from "react";

import Layout from "../components/layout";
import TalkCard from "../components/talkCard";
import SEO from "../components/seo";
import sketchnoting from "../images/taking-notes.svg";

const Hero = () => (
const Hero = ({ talks }) => (
<div className="text-center">
<h1 className="text-5xl font-extrabold text-blue-500 leading-9 tracking-tight font-inter">
October 7th, 2020
Expand All @@ -27,22 +29,42 @@ const Hero = () => (
</div>
</div>
<br />
<h2 className="text-5xl font-extrabold text-blue-500 leading-9 tracking-tight font-inter">
<h2
className="text-5xl font-extrabold text-blue-500 leading-9 tracking-tight font-inter p-4"
id="schedule"
>
Schedule
</h2>
Placeholder Text!
{talks.map((talk) => {
return <TalkCard talk={talk.node} key={talk.node.name} />;
})}
</div>
);

function IndexPage() {
const data = useStaticQuery(graphql`
query FetchSpeakers {
allSpeakersYaml {
edges {
node {
id
avatar
name
title
time
}
}
}
}
`);

return (
<Layout>
<SEO
title="Home"
keywords={[`gatsby`, `tailwind`, `react`, `tailwindcss`]}
/>

<Hero />
<Hero talks={data.allSpeakersYaml.edges} />
</Layout>
);
}
Expand Down