UNPKG

@mornya/react-social-libs

Version:

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

1 lines 1.32 kB
var e,t,n=this&&this.__extends||(e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}),o=(Object.defineProperty(exports,"__esModule",{value:!0}),require("../utils/BaseShareComponent")),r=require("../utils/UI"),o=(t=o.BaseShareComponent,n(Band,t),Band.prototype.onInit=function(){this.initialize("Band",{message:function(t){return""}})},Band.prototype.onMount=function(t){this.setApiStep()},Band.prototype.onShare=function(t,n){var e=this,o=(null==(o=t.message)?void 0:o.call(t,n))||n.title+"\n\n"+"".concat(n.description).concat(this.getHashtag(t.hashtags,"\n"))+"\n\n"+n.url+"\n";(0,r.openShareWindow)(this.mapToParam(Band.LINK_URL,{body:o,route:n.url}),"band",this.deviceInfo.isMobile?[]:[700,698]).then(function(){return e.onComplete(!0,null)}).catch(function(t){return console.error(t)})},Band.LINK_URL="https://www.band.us/plugin/share",Band);function Band(){return null!==t&&t.apply(this,arguments)||this}exports.default=o;