Advertisement
dfghgfhplkjbv

src/templates/Job.js

Mar 4th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 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. fluid {
  55. ...GatsbyDatoCmsFluid
  56. }
  57. }
  58. companyName
  59. contactEmail
  60. aboutCompanyNode {
  61. childMarkdownRemark {
  62. html
  63. }
  64. }
  65. }
  66. jobTags: allDatoCmsJobTag(filter: { locale: { eq: $locale } }) {
  67. edges {
  68. node {
  69. title
  70. locale
  71. id
  72. }
  73. }
  74. }
  75. offers: allDatoCmsJob(filter: { locale: { eq: $locale } }) {
  76. edges {
  77. node {
  78. locale
  79. id
  80. description
  81. companyName
  82. companyLogo {
  83. url
  84. }
  85. tag {
  86. id
  87. title
  88. }
  89. slug
  90. }
  91. }
  92. }
  93. subscribe: file(relativePath: { eq: "subscribe-illustration.jpeg" }) {
  94. childImageSharp {
  95. fluid(maxWidth: 1440) {
  96. ...GatsbyImageSharpFluid
  97. }
  98. }
  99. }
  100. }
  101. `
  102.  
  103. export default withLocale(SingleJobPage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement