const { Component } = require('inferno');
const { cacheComponent } = require('../util/cache');
class LiveRe extends Component {
render() {
const { uid } = this.props;
if (!uid) {
return
You forgot to set the uid
for LiveRe.
Please set it in _config.yml
.
;
}
const js = `(function(d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') { return; }
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');`;
return
;
}
}
module.exports = cacheComponent(LiveRe, 'comment.livere', props => {
const { comment } = props;
return {
uid: comment.uid
};
});