UNPKG

@mornya/react-social-libs

Version:

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

1 lines 1.62 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 __)}),r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=(Object.defineProperty(exports,"__esModule",{value:!0}),r(require("react"))),r=require("../utils/BaseWidgetComponent"),a=require("../utils/Loader"),r=(t=r.BaseWidgetComponent,e(TumblrPost,t),TumblrPost.prototype.onInit=function(){this.initialize("Tumblr-Post",{})},TumblrPost.prototype.onRender=function(t,e){var o=null!=(o=t.hashtags)&&o.length?t.hashtags.join(","):"",t=window.navigator.language.replace(/-/,"_");return n.default.createElement("a",{id:this.id,href:TumblrPost.LINK_URL,className:"tumblr-share-button","data-color":"blue","data-notes":"right","data-posttype":"link","data-title":e.title,"data-content":e.url,"data-caption":e.description,"data-tags":o,"data-locale":t},n.default.createElement("span",{style:{fontSize:0,lineHeight:0}},"Tumblr Post"))},TumblrPost.prototype.onMount=function(t){var e=this;(0,a.initTumblrSDK)().then(function(){return e.setApiStep()}).catch(console.error)},TumblrPost.LINK_URL="https://embed.tumblr.com/share",TumblrPost);function TumblrPost(){return null!==t&&t.apply(this,arguments)||this}exports.default=r;