Advertisement
dfghgfhplkjbv

src/templates/Video.js

Mar 1st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 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 NewsFeed from 'src/components/NewsFeed'
  6. import SubscribeMain from 'src/components/Subscribe'
  7. import Footer from 'src/components/Footer'
  8. import Home from 'src/components/Home'
  9. import Header from 'src/components/Header'
  10. import SingleVideo from 'src/components/SingleVideo'
  11. import withLocale from 'src/components/withLocale'
  12.  
  13. class Video extends Component {
  14. render() {
  15. const {
  16. data: { news, video, subscribe },
  17. locale,
  18. changeLocale,
  19. } = this.props
  20.  
  21. return (
  22. <Layout locale={locale}>
  23. <LayoutHelmet locale={locale} />
  24. <main>
  25. <Header
  26. {...this.props}
  27. locale={locale}
  28. full={true}
  29. style={{ backgroundColor: '#161616' }}
  30. changeLocale={changeLocale}
  31. />
  32. <SingleVideo data={video} />
  33. <NewsFeed news={news} inversed />
  34. <Home onChangeData={this.props.onChangeData} locale={locale} />
  35. <SubscribeMain locale={locale} subscribe={subscribe} />
  36. </main>
  37. <Footer locale={locale} />
  38. </Layout>
  39. )
  40. }
  41. }
  42.  
  43. export const query = graphql`
  44. query($id: String!) {
  45. video: datoCmsSingleVideo(id: { eq: $id }) {
  46. title
  47. videoId
  48. }
  49.  
  50. news: allDatoCmsNews(filter: { ismain: { eq: true } }, sort: { fields: [publishdate], order: DESC }, limit: 3) {
  51. edges {
  52. node {
  53. publishdate
  54. slug
  55. title
  56. description
  57. ismain
  58. image {
  59. id
  60. fluid(maxWidth: 1240, imgixParams: { fm: "jpg", auto: "compress, format" }) {
  61. ...GatsbyDatoCmsFluid
  62. }
  63. }
  64. author
  65. }
  66. }
  67. }
  68. subscribe: file(relativePath: { eq: "subscribe-illustration.jpeg" }) {
  69. childImageSharp {
  70. fluid(maxWidth: 1440) {
  71. ...GatsbyImageSharpFluid
  72. }
  73. }
  74. }
  75. }
  76. `
  77.  
  78. export default withLocale(Video)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement