'use strict';
const { Component, Fragment } = require('inferno');
const { cacheComponent } = require('../util/cache');
class Valine extends Component {
render() {
const { appId, appKey, notify, verify, placeholder } = this.props;
if (!appId || !appKey) {
return
You forgot to set the app_id
or app_key
for Valine.
Please set it in _config.yml
.
;
}
const js = `new Valine({
el: '#valine-thread' ,
notify: ${notify},
verify: ${verify},
app_id: '${appId}',
app_key: '${appKey}',
placeholder: '${placeholder}'
});`;
return
;
}
}
module.exports = cacheComponent(Valine, 'comment.valine', props => {
const { comment } = props;
return {
appId: comment.app_id,
appKey: comment.app_key,
notify: comment.notify,
verify: comment.verify,
placeholder: comment.placeholder
};
});