Advertisement
dfghgfhplkjbv

src/templates/Videos.js

Mar 1st, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import { graphql } from 'gatsby'
  3. import Header from '../components/Header'
  4. import VideosList from '../components/VideosList'
  5. import Subscribe from '../components/Subscribe'
  6. import Footer from '../components/Footer'
  7. import PageHelmet from 'src/components/PageHelmet'
  8. import withLocale from 'src/components/withLocale'
  9. import { subDays } from 'date-fns'
  10.  
  11. class Videos extends Component {
  12. render() {
  13. const {
  14. data: { channels, subscribe },
  15. locale,
  16. changeLocale,
  17. } = this.props
  18.  
  19. return (
  20. <div>
  21. <PageHelmet title="Videos" locale={locale} />
  22. <Header full={true} {...this.props} locale={locale} changeLocale={changeLocale} />
  23. <VideosList videos={channels} locale={locale} />
  24. <Subscribe style={{ marginTop: '15px' }} locale={locale} subscribe={subscribe} />
  25. <Footer locale={locale} />
  26. </div>
  27. )
  28. }
  29. }
  30.  
  31. export const query = graphql`
  32. query {
  33. channels: allDatoCmsVideo {
  34. edges {
  35. node {
  36. videos {
  37. title
  38. videoId
  39. description
  40. duration
  41. publishDate
  42. slug
  43. }
  44. }
  45. }
  46. }
  47. subscribe: file(relativePath: { eq: "subscribe-illustration.jpeg" }) {
  48. childImageSharp {
  49. fluid(maxWidth: 1440) {
  50. ...GatsbyImageSharpFluid
  51. }
  52. }
  53. }
  54. }
  55. `
  56.  
  57. export default withLocale(Videos)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement