/**
* AddThis share buttons JSX component.
* @module view/share/addthis
*/
const { Component } = require('inferno');
const { cacheComponent } = require('../../util/cache');
const { deprecate } = require('../../util/deprecate');
/**
* AddThis share buttons JSX component.
*
* @deprecated AddThis shut down on May 31, 2023. Use AddToAny or ShareThis instead.
* @see https://www.addthis.com/dashboard
* @example
* <AddThis installUrl="******" />
*/
class AddThis extends Component {
render() {
deprecate('share.addthis', 'Service shut down. Use AddToAny or ShareThis.');
return (
<div class="notification is-danger" role="status">
AddThis shut down on May 31, 2023. Set <code>share.type</code> to <code>web_share</code>,{' '}
<code>addtoany</code>, or <code>sharethis</code>.
</div>
);
}
}
/**
* Cacheable AddThis share buttons JSX component.
* <p>
* This class is supposed to be used in combination with the <code>locals</code> hexo filter
* ({@link module:hexo/filter/locals}).
*
* @see module:util/cache.cacheComponent
* @example
* <AddThis.Cacheable share={{ install_url: '******' }} />
*/
AddThis.Cacheable = cacheComponent(AddThis, 'share.addthis', (props) => {
const { share } = props;
return {
installUrl: share.install_url,
};
});
module.exports = AddThis;