hexo-theme-amane/layout/plugin/progressbar.jsx

21 lines
486 B
React
Raw Normal View History

const { Component } = require('inferno');
2019-12-22 17:16:19 +00:00
const { cacheComponent } = require('../util/cache');
class ProgressBar extends Component {
render() {
const { jsUrl } = this.props;
2019-12-22 17:16:19 +00:00
return <script src={jsUrl}></script>;
2019-12-22 17:16:19 +00:00
}
}
module.exports = cacheComponent(ProgressBar, 'plugin.progressbar', props => {
const { head, helper } = props;
if (!head) {
2019-12-22 17:16:19 +00:00
return null;
}
return {
jsUrl: helper.cdn('pace-js', '1.0.2', 'pace.min.js')
2019-12-22 17:16:19 +00:00
};
});