@mornya/react-social-libs
Version:
The project of React.js Social Share and Widget modules.
1 lines • 1.32 kB
JavaScript
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 __)}),r=(Object.defineProperty(exports,"__esModule",{value:!0}),require("../utils/BaseShareComponent")),n=require("../utils/UI"),r=(t=r.BaseShareComponent,e(Twitter,t),Twitter.prototype.onInit=function(){this.initialize("Twitter",{message:function(t){return"[".concat(t.title,"] ").concat(t.description)},hashtags:[]})},Twitter.prototype.onMount=function(t){this.setApiStep()},Twitter.prototype.onShare=function(t,e){var o,r=this;(0,n.openShareWindow)(this.mapToParam(Twitter.LINK_URL,{text:null==(o=t.message)?void 0:o.call(t,e),url:e.url,hashtags:t.hashtags}),"twitter",this.deviceInfo.isMobile?[]:[550,445]).then(function(){return r.onComplete(!0,null)}).catch(function(t){return console.error(t)})},Twitter.LINK_URL="https://twitter.com/share",Twitter);function Twitter(){return null!==t&&t.apply(this,arguments)||this}exports.default=r;