2018-08-27 15:24:23 +02:00
import React , { Component } from 'react'
2018-06-27 13:22:17 +02:00
import Helmet from 'react-helmet'
2018-08-29 14:05:56 +02:00
import Prism from 'prismjs'
2018-09-12 14:35:30 +02:00
import SEO from '../components/SEO'
2018-08-29 14:05:56 +02:00
2018-09-12 12:32:22 +02:00
require ( 'prismjs/themes/prism-tomorrow.css' )
2018-08-29 14:05:56 +02:00
2018-08-30 11:07:16 +02:00
import PageTransition from 'gatsby-plugin-page-transitions'
2018-09-05 23:01:06 +02:00
import MessengerCustomerChat from 'react-messenger-customer-chat'
2018-09-05 13:13:04 +02:00
import favicon32 from '../images/favicon32.png'
2018-06-27 10:35:17 +02:00
class PostDefault extends Component {
2018-08-29 14:05:56 +02:00
componentDidMount ( ) {
Prism . highlightAll ( )
}
2018-09-12 12:32:22 +02:00
componentDidUpdate ( ) {
Prism . highlightAll ( )
}
2018-06-25 15:28:50 +02:00
render ( ) {
const { data } = this . props
return (
2018-08-30 11:07:16 +02:00
< PageTransition >
2018-09-12 14:35:30 +02:00
< SEO siteTitle = { data . wordpressPost . title } siteDescription = "We are always on a lookout for exciting challenges. Feel free to contact us if you want to start something great or just have any questions" siteImage = { data . wordpressPost . featured _media . source _url } siteUrl = { ` https://www.saburly.com/blog/ ${ data . wordpressPost . slug } ` } / >
2018-06-27 13:22:17 +02:00
< Helmet
2018-09-05 13:13:04 +02:00
link = { [
{ rel : 'shortcut icon' , type : 'image/png' , href : ` ${ favicon32 } ` } ,
] }
2018-06-27 13:22:17 +02:00
/ >
2018-09-05 12:15:12 +02:00
< main className = "container mx-auto p-4 max-w-lg sm:p-10" >
2018-09-12 12:06:57 +02:00
< img
className = "w-full rounded"
src = {
data . wordpressPost . featured _media
? data . wordpressPost . featured _media . source _url
: ''
}
/ >
< h1 className = "mt-4" > { data . wordpressPost . title } < / h 1 >
2018-08-27 15:24:23 +02:00
< div
2018-09-12 12:06:57 +02:00
className = "leading-normal blog-post font-serif"
2018-08-27 15:24:23 +02:00
dangerouslySetInnerHTML = { {
_ _html : data . wordpressPost . content ,
} }
/ >
2018-09-05 23:01:06 +02:00
< MessengerCustomerChat
pageId = "715686642152482"
appId = "1896398823783343"
htmlRef = "blogpost"
/ >
2018-08-27 15:24:23 +02:00
< / m a i n >
2018-08-30 11:07:16 +02:00
< / P a g e T r a n s i t i o n >
2018-08-27 15:24:23 +02:00
)
2018-06-25 15:28:50 +02:00
}
}
export const query = graphql `
2018-06-27 10:35:17 +02:00
query PostDefaultQuery ( $slug : String ! ) {
2018-08-27 15:24:23 +02:00
wordpressPost ( slug : { eq : $slug } ) {
2018-06-25 15:28:50 +02:00
title
slug
content
2018-09-12 12:06:57 +02:00
date ( formatString : "MMMM DD, YYYY" )
featured _media {
source _url
}
2018-06-25 15:28:50 +02:00
}
}
`
2018-08-27 15:24:23 +02:00
export default PostDefault