Created
April 5, 2018 01:36
-
-
Save tnormington/f82160ab98d404b9e91774683c733678 to your computer and use it in GitHub Desktop.
A Disqus Thread React component, pass in a URL and a unique ID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
export default class DisqusThread extends Component { | |
constructor(props) { | |
super(props) | |
window.disqus_config = { | |
page: { | |
url: props.url, | |
identifier: props.identified | |
} | |
}; | |
(function() { // DON'T EDIT BELOW THIS LINE | |
var d = document, s = d.createElement('script'); | |
s.src = 'https://tjn-io.disqus.com/embed.js'; | |
s.setAttribute('data-timestamp', +new Date()); | |
(d.head || d.body).appendChild(s); | |
})(); | |
} | |
render() { | |
return ( | |
<div id="disqus_thread" /> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment