UNPKG

@mornya/react-social-libs

Version:

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

48 lines (47 loc) 2.15 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { DynamicLoad } from '@mornya/dynamic-load-libs'; import React from 'react'; import { BaseWidgetComponent } from '../utils/BaseWidgetComponent'; var FlipboardFlipit = (function (_super) { __extends(FlipboardFlipit, _super); function FlipboardFlipit() { return _super !== null && _super.apply(this, arguments) || this; } FlipboardFlipit.prototype.onInit = function () { this.initialize('Flipboard-Flipit', { profileUrl: '', popover: 'Flip it!', }); }; FlipboardFlipit.prototype.onRender = function (extra) { return (React.createElement("a", { id: this.id, href: "".concat(FlipboardFlipit.LINK_URL, "/").concat(extra.profileUrl), "data-flip-widget": "flipit", title: extra.popover, style: { height: '18px' } }, extra.popover)); }; FlipboardFlipit.prototype.onMount = function (_extra) { var _this = this; DynamicLoad.script({ id: 'fl-jssdk', src: FlipboardFlipit.SDK_URL, isReload: true, }) .then(function () { return _this.setApiStep(); }) .catch(function () { }); }; FlipboardFlipit.SDK_URL = 'https://cdn.flipboard.com/web/buttons/js/flbuttons.min.js'; FlipboardFlipit.LINK_URL = 'https://flipboard.com'; return FlipboardFlipit; }(BaseWidgetComponent)); export default FlipboardFlipit;