react-juicer-feed
Version:
React component to display Juicer.io aggregated social media feeds.
2 lines (1 loc) • 2.01 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e=e||self).JuicerFeed=t(e.React)}(this,function(o){"use strict";var i="default"in o?o.default:o;function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}return function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,c(e).apply(this,arguments))}var t,r,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(e,o.Component),t=e,(r=[{key:"componentDidMount",value:function(){document.querySelector(".juicer-io-resources-wrapper")||this.appendResourcesWrapper()}},{key:"appendResourcesWrapper",value:function(){var e=document.createElement("div");e.setAttribute("class","juicer-io-resources-wrapper");var t=document.createElement("script");t.src="https://assets.juicer.io/embed.js",t.type="text/javascript";var r=document.createElement("link");r.media="all",r.rel="stylesheet",r.href="https://assets.juicer.io/embed.css",r.type="text/css",e.appendChild(t),e.appendChild(r),document.body.appendChild(e)}},{key:"render",value:function(){return i.createElement("ul",{className:"juicer-feed","data-feed-id":this.props.feedId})}}])&&u(t.prototype,r),n&&u(t,n),e}()});