-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor events with template and Gatsby data layer
- Loading branch information
Showing
8 changed files
with
151 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from "react" | ||
import { graphql } from "gatsby" | ||
import {PageLinks} from "../components/PageLinks"; | ||
import {Footer} from "../components/Footer"; | ||
import "../components/events/events.scss" | ||
|
||
interface eventsProps { | ||
data: { | ||
eventsJson: { | ||
Information: { | ||
Description: string, | ||
Image: string, | ||
Title: string | ||
}[], | ||
BackgroundColor: string | ||
} | ||
} | ||
} | ||
|
||
const events2020: React.FC<eventsProps> = ({ data }) => { | ||
const info = data.eventsJson.Information; | ||
const bg = data.eventsJson.BackgroundColor; | ||
const timelineItems = info.map((item) => ( | ||
<div className="timeline-item" data-text={item.Title} key={item.Title}> | ||
{/* TODO: Kinda dumb but you need to have a bit of the string static or else Webkit starts to complain */} | ||
<div className="timeline__content"><img className="timeline__img" src={require(`../images/${item.Image}`)}/> | ||
<p className="timeline__content-desc">{item.Description}</p> | ||
</div> | ||
</div> | ||
)); | ||
return( | ||
<body style={{backgroundImage: "None", backgroundColor: bg}}> | ||
<div className="timeline-header"> | ||
<PageLinks /> | ||
<div className="timeline-container" style={{backgroundColor: `${bg}`}}> | ||
<div className="timeline"> | ||
{timelineItems} | ||
</div> | ||
</div> | ||
<Footer /> | ||
</div> | ||
</body> | ||
); | ||
}; | ||
|
||
export const query = graphql` | ||
query($slug: String!) { | ||
eventsJson(fields: { slug: { eq: $slug } }) { | ||
BackgroundColor | ||
Information { | ||
Description | ||
Image | ||
Title | ||
} | ||
} | ||
}` | ||
|
||
export default events2020; |