-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d46c1d7
commit 733561f
Showing
14 changed files
with
515 additions
and
165 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
File renamed without changes.
File renamed without changes.
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,38 @@ | ||
import React from "react" | ||
|
||
import { ProcessedPost } from '../../../components/BlogPostProcessor' | ||
import { GatsbyImage } from "gatsby-plugin-image" | ||
|
||
const Topic = ({ Title, Description, Icon }) => { | ||
return ( | ||
<div className="topic"> | ||
<div className="icon"> | ||
<GatsbyImage | ||
alt={Title} | ||
image={Icon.localFile.childImageSharp.gatsbyImageData} | ||
loading="lazy" | ||
/> | ||
</div> | ||
<div className="content"> | ||
<p className="title">{Title}</p> | ||
<p className="description">{Description}</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
const CaseStudyAbout = ({ Title, Description, Topics }) => { | ||
return ( | ||
<div className="about"> | ||
<p className="title">{Title}</p> | ||
<div className="topics"> | ||
{Topics.map((topic, index) => <Topic key={index} {...topic} />)} | ||
</div> | ||
<div className="description"> | ||
<ProcessedPost body={Description.data.childHtmlRehype.html} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default CaseStudyAbout |
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,13 @@ | ||
import React from "react" | ||
|
||
import { ProcessedPost } from '../../../components/BlogPostProcessor' | ||
|
||
const CaseStudyBody = ({ content }) => { | ||
return ( | ||
<div className="body"> | ||
<ProcessedPost body={content.data.childHtmlRehype.html} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default CaseStudyBody |
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,13 @@ | ||
import React from "react" | ||
|
||
import { ProcessedPost } from '../../../components/BlogPostProcessor' | ||
|
||
const CaseStudyContent = ({ content }) => { | ||
return ( | ||
<div className="side-content"> | ||
<ProcessedPost body={content.data.childHtmlRehype.html} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default CaseStudyContent |
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,22 @@ | ||
import React from "react" | ||
import { GatsbyImage } from "gatsby-plugin-image" | ||
|
||
const CaseStudyHero = ({ title, description, image }) => { | ||
return ( | ||
<header className="above-the-fold"> | ||
<div className="content"> | ||
<h2>{title}</h2> | ||
<h1>{description}</h1> | ||
</div> | ||
<div className="logo"> | ||
<GatsbyImage | ||
alt={title} | ||
image={image} | ||
loading="eager" | ||
/> | ||
</div> | ||
</header> | ||
) | ||
} | ||
|
||
export default CaseStudyHero |
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,19 @@ | ||
import React from "react" | ||
|
||
import Layout from "../../../components/layout" | ||
|
||
const CaseStudyWrapper = ({ children }) => { | ||
return ( | ||
<Layout headerTheme="light"> | ||
<article | ||
className="case-study" | ||
itemScope | ||
itemType="http://schema.org/Article" | ||
> | ||
{children} | ||
</article> | ||
</Layout> | ||
) | ||
} | ||
|
||
export default CaseStudyWrapper |
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,111 @@ | ||
import './style.less' | ||
|
||
import React from "react" | ||
import { graphql } from "gatsby" | ||
|
||
import dayjs from "dayjs" | ||
import reltime from "dayjs/plugin/relativeTime" | ||
|
||
import Header from './Head' | ||
import Wrapper from './Wrapper' | ||
|
||
import SectionHero from './Sections/Hero' | ||
import SectionContent from './Sections/Content' | ||
import SectionAbout from './Sections/About' | ||
import SectionBody from './Sections/Body' | ||
|
||
dayjs.extend(reltime) | ||
|
||
const CaseStudyTemplate = ({ data: { caseStudy, relatedStudies } }) => { | ||
const { Title, Description, Logo, SideContent, About, Body } = caseStudy | ||
|
||
return ( | ||
<Wrapper> | ||
<SectionHero title={Title} description={Description} image={Logo.localFile.childImageSharp.gatsbyImageData} /> | ||
<div className="two-columns"> | ||
<SectionContent content={SideContent} /> | ||
<SectionAbout {...About} /> | ||
</div> | ||
<SectionBody content={Body} /> | ||
</Wrapper> | ||
) | ||
} | ||
|
||
export default CaseStudyTemplate | ||
|
||
export const Head = Header | ||
|
||
export const pageQuery = graphql` | ||
query CaseStudyQueryById($id: String!) { | ||
site { | ||
siteMetadata { | ||
siteUrl | ||
} | ||
} | ||
caseStudy: strapiCaseStudy(id: { eq: $id }) { | ||
machineReadablePublishDate: publishedAt(formatString: "YYYY-MM-DD") | ||
Slug | ||
Title | ||
Description | ||
Logo { | ||
localFile { | ||
childImageSharp { | ||
gatsbyImageData( | ||
layout: FULL_WIDTH | ||
placeholder: BLURRED | ||
formats: [AUTO, WEBP, AVIF] | ||
) | ||
meta_img: fixed(width: 500) { | ||
src | ||
} | ||
} | ||
} | ||
} | ||
SideContent { | ||
data { | ||
SideContent | ||
childHtmlRehype { | ||
html | ||
tableOfContents | ||
} | ||
} | ||
} | ||
About { | ||
Title | ||
Description { | ||
data { | ||
Description | ||
childHtmlRehype { | ||
html | ||
tableOfContents | ||
} | ||
} | ||
} | ||
Topics { | ||
Title | ||
Description | ||
Icon { | ||
localFile { | ||
childImageSharp { | ||
gatsbyImageData( | ||
layout: FULL_WIDTH | ||
placeholder: BLURRED | ||
formats: [AUTO, WEBP, AVIF] | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
Body { | ||
data { | ||
Body | ||
childHtmlRehype { | ||
html | ||
tableOfContents | ||
} | ||
} | ||
} | ||
} | ||
} | ||
` |
Oops, something went wrong.