Advertisement
dfghgfhplkjbv

src/templates/Job.js

Mar 1st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import { graphql } from 'gatsby'
  3. import Header from 'src/components/Header'
  4. import PageHelmet from 'src/components/PageHelmet'
  5. import Subscribe from 'src/components/Subscribe'
  6. import SingleJob from 'src/components/SingleJob'
  7. import Footer from 'src/components/Footer'
  8. import Jobs from 'src/components/Jobs'
  9. import withLocale from 'src/components/withLocale'
  10.  
  11. class SingleJobPage extends Component {
  12. render() {
  13. const {
  14. data: {
  15. job,
  16. jobTags: { edges: jobTags },
  17. offers: { edges: offers },
  18. subscribe,
  19. },
  20. locale,
  21. changeLocale,
  22. } = this.props
  23.  
  24. return (
  25. <>
  26. {/* TODO Add real meta-date */}
  27. <PageHelmet title="Job" locale={locale} />
  28. <Header full={true} locale={locale} changeLocale={changeLocale} />
  29. <SingleJob job={job} locale={locale} />
  30. <Jobs jobTags={jobTags} offers={offers} locale={locale} />
  31. <Subscribe subscribe={subscribe} />
  32. <Footer locale={locale} />
  33. </>
  34. )
  35. }
  36. }
  37.  
  38. export const query = graphql`
  39. query SingleJob($id: String!, $locale: String!) {
  40. job: datoCmsJob(locale: { eq: $locale }, id: { eq: $id }) {
  41. title
  42. descriptionNode {
  43. childMarkdownRemark {
  44. html
  45. }
  46. }
  47. geolocation {
  48. latitude
  49. longitude
  50. }
  51. locationDescription
  52. photo {
  53. url
  54. }
  55. companyName
  56. contactEmail
  57. aboutCompanyNode {
  58. childMarkdownRemark {
  59. html
  60. }
  61. }
  62. }
  63. jobTags: allDatoCmsJobTag(filter: { locale: { eq: $locale } }) {
  64. edges {
  65. node {
  66. title
  67. locale
  68. id
  69. }
  70. }
  71. }
  72. offers: allDatoCmsJob(filter: { locale: { eq: $locale } }) {
  73. edges {
  74. node {
  75. locale
  76. id
  77. description
  78. companyName
  79. companyLogo {
  80. url
  81. }
  82. tag {
  83. id
  84. title
  85. }
  86. slug
  87. }
  88. }
  89. }
  90. subscribe: file(relativePath: { eq: "subscribe-illustration.jpeg" }) {
  91. childImageSharp {
  92. fluid(maxWidth: 1440) {
  93. ...GatsbyImageSharpFluid
  94. }
  95. }
  96. }
  97. }
  98. `
  99.  
  100. export default withLocale(SingleJobPage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement