UNPKG

@mornya/react-social-libs

Version:

The project of React.js Social Share and Widget modules.

1 lines 1.25 kB
var o,t,e=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}))(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}),n=(Object.defineProperty(exports,"__esModule",{value:!0}),require("../utils/BaseShareComponent")),i=require("../utils/UI"),n=(t=n.BaseShareComponent,e(Reddit,t),Reddit.prototype.onInit=function(){this.initialize("Reddit",{title:function(t){return null!=(t=t.title)?t:""}})},Reddit.prototype.onMount=function(t){this.setApiStep()},Reddit.prototype.onShare=function(t,e){var o,n=this;(0,i.openShareWindow)(this.mapToParam(Reddit.LINK_URL,{url:e.url,title:null==(o=t.title)?void 0:o.call(t,e)}),"reddit",this.deviceInfo.isMobile?[]:[640,640]).then(function(){return n.onComplete(!0,null)}).catch(function(t){return console.error(t)})},Reddit.LINK_URL="https://reddit.com/submit",Reddit);function Reddit(){return null!==t&&t.apply(this,arguments)||this}exports.default=n;