{"size": 3071, "ext": "js", "max_stars_repo_path": "src/templates/case-study.js", "max_stars_repo_name": "SamSaprykin/tides-agency", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/templates/case-study.js", "max_issues_repo_name": "SamSaprykin/tides-agency", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/templates/case-study.js", "max_forks_repo_name": "SamSaprykin/tides-agency", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.3804347826, "max_line_length": 110, "alphanum_fraction": 0.590035819}
import React from "react"

import Layout from "../components/layout"
import SEO from "../components/seo"

import ProjectNameSection from "../components/CaseStudyPage/ProjectNameSection/projectNameSection"
import AboutProjectSection from "../components/CaseStudyPage/AboutProjectSection/aboutProjectSection"
import ServicesProjectSection from "../components/CaseStudyPage/ServicesProjectSection/servicesProjectSection"
import GalleryProjectSection from "../components/CaseStudyPage/GalleryProjectSection/galleryProjectSection"
import AuthorsProjectSection from "../components/CaseStudyPage/AuthorsProjectSection/authorsProjectSection"

const CaseStudy = props => {
  const components = props.data.contentfulCaseStudyPage.components
  const anchorId = props.data.contentfulCaseStudyPage.slug
  const projectAnchor = `/case-study/${anchorId}#${anchorId}`
  return (
    <Layout anchorId={projectAnchor}>
      <SEO 
        title={`Tides project: ${anchorId}`}
        keywords={[`finished projects`, `applications`, `web design`, `marketing`]} 
        description="This is our finished projects"
      />
      {components?.map(ele => {
          const type = ele.__typename;
          if (type === 'ContentfulTitleSectionCaseStudy') {
            return (
              <ProjectNameSection data={ele} anchorId={anchorId}/>
            )
          } else if (type === 'ContentfulAboutSectionCaseStudy') {
            return  <AboutProjectSection data={ele} /> ;
          } else if (type === 'ContentfulServicesSectionCaseStudy') {
            return  <ServicesProjectSection data={ele} /> ;
          } else if (type === 'ContentfulGallerySectionCaseStudy') {
            return  <GalleryProjectSection data={ele} /> ;
          } else if (type === 'ContentfulProjectTeamCaseStudy') {
            return  <AuthorsProjectSection data={ele} /> ;
          } 
       })} 
    </Layout>   
  )
}


export default CaseStudy

export const CaseStudyPageQuery = graphql`
  query CaseStudyPageQuery($slug: String!) {
    contentfulCaseStudyPage(slug: { eq: $slug }) {
      id
      slug
        components {
          ... on ContentfulAboutSectionCaseStudy {
            siteLink
            id
            launchDate(formatString: "")
            description {
              description
            }
          }
          ... on ContentfulGallerySectionCaseStudy {
            id
            galleryItem {
              marqueeText
              workTypeImages {
                description
                file {
                  url
                }
              }
            }
          }
          ... on ContentfulProjectTeamCaseStudy {
            teamMember
          }
          ... on ContentfulServicesSectionCaseStudy {
            id
            projectAwwards
            services
            mainImage {
              fluid(maxWidth: 1200) {
                ...GatsbyContentfulFluid_withWebp
              }
            }
          }
          ... on ContentfulTitleSectionCaseStudy {
            id
            tItle
          }
        } 			
      }
    }
`