dfghgfhplkjbv

src/templates/Interview.js

Mar 1st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import { graphql } from 'gatsby'
  3. import Layout from 'src/components/Layout'
  4. import LayoutHelmet from 'src/components/LayoutHelmet'
  5. import Footer from 'src/components/Footer'
  6. import Cover from 'src/components/Cover'
  7. import Interview from 'src/components/Interview'
  8. import Subscribe from 'src/components/Subscribe'
  9. import PageHelmet from 'src/components/PageHelmet'
  10. import withLocale from 'src/components/withLocale'
  11.  
  12. class InterviewTemplate extends Component {
  13. render() {
  14. const {
  15. data: { interview, subscribe },
  16. locale,
  17. changeLocale,
  18. } = this.props
  19.  
  20. return (
  21. <Layout locale={locale}>
  22. <LayoutHelmet locale={locale} />
  23. <PageHelmet
  24. title={interview.title}
  25. image={interview.image.url}
  26. description={interview.description}
  27. locale={locale}
  28. />
  29. <Cover
  30. locale={locale}
  31. image={interview.image}
  32. description={interview.description}
  33. title={interview.title}
  34. podcast={interview.podcast}
  35. slug={interview.slug}
  36. changeLocale={changeLocale}
  37. />
  38. <Interview interview={interview} locale={locale} />
  39. <Subscribe locale={locale} subscribe={subscribe} />
  40. <Footer locale={locale} />
  41. </Layout>
  42. )
  43. }
  44. }
  45.  
  46. export const query = graphql`
  47. query InterviewTemplate($id: String!, $locale: String!) {
  48. interview: datoCmsInterview(id: { eq: $id }, locale: { eq: $locale }) {
  49. title
  50. description
  51. author
  52. photographer
  53. publishDate
  54. podcast {
  55. podcastTitle
  56. podcastGuest
  57. podcastCover {
  58. id
  59. fluid(maxWidth: 660, imgixParams: { fm: "jpg", auto: "compress, format" }) {
  60. ...GatsbyDatoCmsFluid
  61. }
  62. }
  63. duration
  64. podcast {
  65. url
  66. }
  67. }
  68. image {
  69. url
  70. fluid(maxWidth: 2560, imgixParams: { fm: "jpg", auto: "compress, format" }) {
  71. ...GatsbyDatoCmsFluid
  72. }
  73. }
  74. summary {
  75. title
  76. description
  77. }
  78. bodyNode {
  79. childMarkdownRemark {
  80. html
  81. }
  82. }
  83. slug
  84. }
  85. subscribe: file(relativePath: { eq: "subscribe-illustration.jpeg" }) {
  86. childImageSharp {
  87. fluid(maxWidth: 1440) {
  88. ...GatsbyImageSharpFluid
  89. }
  90. }
  91. }
  92. }
  93. `
  94.  
  95. export default withLocale(InterviewTemplate)
Add Comment
Please, Sign In to add comment