-
Notifications
You must be signed in to change notification settings - Fork 4
/
component---src-templates-blog-post-tsx-4cd075fddade7c193d8f.js
2 lines (2 loc) · 13.5 KB
/
component---src-templates-blog-post-tsx-4cd075fddade7c193d8f.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{cZrw:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n.n(r),o=n("9Dj+"),i=n("vrFN"),l=n("1Yj4"),c=n("ok1R"),s=n("rhny"),u=n("9eSz"),d=n.n(u),p=n("Jp1G"),m=n("X8hv"),h=n.n(m),f=n("7ljp"),w=n("Wbzz"),b=n("aLZG"),g=n("XAkp"),y=n("3U3o");function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var E=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,v(t,n);var o=r.prototype;return o.componentDidMount=function(){this._updateIframeContent()},o.componentDidUpdate=function(e,t){this._updateIframeContent()},o._defineUrl=function(){var e=this.props,t=e.id,n=e.file;return"https://gist.github.com/"+t+".js"+(n?"?file="+n:"")},o._updateIframeContent=function(){var e=this.props,t=e.id,n=e.file,r=this.iframeNode,a=r.document;r.contentDocument?a=r.contentDocument:r.contentWindow&&(a=r.contentWindow.document);var o='<html><head><base target="_parent"><style>*{font-size:12px;}</style></head><body '+("onload=\"parent.document.getElementById('"+(n?"gist-"+t+"-"+n:"gist-"+t)+"').style.height=document.body.scrollHeight + 'px'\"")+">"+('<script type="text/javascript" src="'+this._defineUrl()+'"><\/script>')+"</body></html>";a.open(),a.writeln(o),a.close()},o.render=function(){var e=this,t=this.props,n=t.id,r=t.file;return a.a.createElement("iframe",{ref:function(t){e.iframeNode=t},width:"100%",frameBorder:0,id:r?"gist-"+n+"-"+r:"gist-"+n})},r}(a.a.PureComponent);const O=e=>{try{return new URL(e).hostname}catch(t){return!1}};function k(e){let{children:t}=e;const{site:n}=Object(w.useStaticQuery)("1271460761");return a.a.createElement(f.MDXProvider,{components:{Alert:e=>a.a.createElement(b.a,Object.assign({},e,{transition:{baseClass:"",timeout:0}}),e.children),LiveCode:y.a,Gist:E,h1:e=>a.a.createElement(a.a.Fragment,null,a.a.createElement("h1",Object.assign({},e,{className:"font-weight-bold pt-4 pb-3 mb-2",style:{lineHeight:"3rem",borderBottom:"1px solid rgba(255, 255, 255, 0.1)"}}),e.children)),h2:e=>a.a.createElement(a.a.Fragment,null,a.a.createElement("h2",Object.assign({},e,{className:"font-weight-bold pt-4 pb-2 mb-2",style:{borderBottom:"1px solid rgba(255, 255, 255, 0.1)"}}),e.children)),p:e=>a.a.createElement("p",Object.assign({},e,{style:{paddingBottom:"1em",lineHeight:"2rem",fontSize:"1.1rem"}}),e.children),table:e=>a.a.createElement("div",{style:{overflowX:"auto"}},a.a.createElement(g.a,e,e.children)),th:e=>a.a.createElement("th",Object.assign({},e,{className:"font-weight-bold"}),e.children),li:e=>a.a.createElement("li",Object.assign({},e,{style:{fontSize:"1.1rem",lineHeight:"2rem"}}),e.children),a:e=>O(e.href)===O(n.siteMetadata.siteUrl)?a.a.createElement(w.Link,Object.assign({},e,{to:e.href,className:e.className})," ",e.children," "):a.a.createElement("a",Object.assign({},e,{href:e.href,className:e.className,rel:"noreferrer",target:"_blank"})," ",e.children," "),img:e=>a.a.createElement("div",{className:"d-flex justify-content-center"},a.a.createElement("img",Object.assign({className:"img-raised"},e),e.children)," ")}},t)}var j,N=(j=function(e,t){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),S=function(e){function t(t){var n=e.call(this,t)||this;return n.name="AssertionError",n}return N(t,e),t}(Error);function _(e,t){if(!e)throw new S(t)}function C(e){var t=Object.entries(e).filter((function(e){var t=e[1];return null!=t})).map((function(e){var t=e[0],n=e[1];return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(String(n)))}));return t.length>0?"?".concat(t.join("&")):""}var x=n("TSYQ"),I=n.n(x),P=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),W=function(){return(W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},D=function(e,t,n,r){return new(n||(n=Promise))((function(a,o){function i(e){try{c(r.next(e))}catch(t){o(t)}}function l(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}c((r=r.apply(e,t||[])).next())}))},B=function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&o[0]?r.return:o[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;switch(r=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(l){o=[6,l],r=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}},H=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},L=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},U=function(e,t){return{left:window.outerWidth/2+(window.screenX||window.screenLeft||0)-e/2,top:window.outerHeight/2+(window.screenY||window.screenTop||0)-t/2}},A=function(e,t){return{top:(window.screen.height-t)/2,left:(window.screen.width-e)/2}};function T(e,t,n){var r=t.height,a=t.width,o=H(t,["height","width"]),i=W({height:r,width:a,location:"no",toolbar:"no",status:"no",directories:"no",menubar:"no",scrollbars:"yes",resizable:"no",centerscreen:"yes",chrome:"yes"},o),l=window.open(e,"",Object.keys(i).map((function(e){return"".concat(e,"=").concat(i[e])})).join(", "));if(n)var c=window.setInterval((function(){try{(null===l||l.closed)&&(window.clearInterval(c),n(l))}catch(e){console.error(e)}}),1e3);return l}var R=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.openShareDialog=function(e){var n=t.props,r=n.onShareWindowClose,a=n.windowHeight,o=void 0===a?400:a,i=n.windowPosition,l=void 0===i?"windowCenter":i,c=n.windowWidth,s=void 0===c?550:c;T(e,W({height:o,width:s},"windowCenter"===l?U(s,o):A(s,o)),r)},t.handleClick=function(e){return D(t,void 0,void 0,(function(){var t,n,r,a,o,i,l,c,s,u;return B(this,(function(d){switch(d.label){case 0:return t=this.props,n=t.beforeOnClick,r=t.disabled,a=t.networkLink,o=t.onClick,i=t.url,l=t.openShareDialogOnClick,c=t.opts,s=a(i,c),r?[2]:(e.preventDefault(),n?(u=n(),L(u)?[4,u]:[3,2]):[3,2]);case 1:d.sent(),d.label=2;case 2:return l&&this.openShareDialog(s),o&&o(e,s),[2]}}))}))},t}return P(t,e),t.prototype.render=function(){var e=this.props,t=(e.beforeOnClick,e.children),n=e.className,r=e.disabled,o=e.disabledStyle,i=e.forwardedRef,l=(e.networkLink,e.networkName),c=(e.onShareWindowClose,e.openShareDialogOnClick,e.opts,e.resetButtonStyle),s=e.style,u=(e.url,e.windowHeight,e.windowPosition,e.windowWidth,H(e,["beforeOnClick","children","className","disabled","disabledStyle","forwardedRef","networkLink","networkName","onShareWindowClose","openShareDialogOnClick","opts","resetButtonStyle","style","url","windowHeight","windowPosition","windowWidth"])),d=I()("react-share__ShareButton",{"react-share__ShareButton--disabled":!!r,disabled:!!r},n),p=W(W(c?{backgroundColor:"transparent",border:"none",padding:0,font:"inherit",color:"inherit",cursor:"pointer"}:{},s),r&&o);return a.a.createElement("button",W({},u,{"aria-label":u["aria-label"]||l,className:d,onClick:this.handleClick,ref:i,style:p}),t)},t.defaultProps={disabledStyle:{opacity:.6},openShareDialogOnClick:!0,resetButtonStyle:!0},t}(r.Component),z=function(){return(z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};var q=function(e,t,n,o){function i(r,i){var l=n(r),c=z({},r);return Object.keys(l).forEach((function(e){delete c[e]})),a.a.createElement(R,z({},o,c,{forwardedRef:i,networkName:e,networkLink:t,opts:n(r)}))}return i.displayName="ShareButton-".concat(e),Object(r.forwardRef)(i)};var F=q("facebook",(function(e,t){var n=t.quote,r=t.hashtag;return _(e,"facebook.url"),"https://www.facebook.com/sharer/sharer.php"+C({u:e,quote:n,hashtag:r})}),(function(e){return{quote:e.quote,hashtag:e.hashtag}}),{windowWidth:550,windowHeight:400});var X=q("twitter",(function(e,t){var n=t.title,r=t.via,a=t.hashtags,o=void 0===a?[]:a,i=t.related,l=void 0===i?[]:i;return _(e,"twitter.url"),_(Array.isArray(o),"twitter.hashtags is not an array"),_(Array.isArray(l),"twitter.related is not an array"),"https://twitter.com/share"+C({url:e,text:n,via:r,hashtags:o.length>0?o.join(","):void 0,related:l.length>0?l.join(","):void 0})}),(function(e){return{hashtags:e.hashtags,title:e.title,via:e.via,related:e.related}}),{windowWidth:550,windowHeight:400});var G=q("linkedin",(function(e,t){var n=t.title,r=t.summary,a=t.source;return _(e,"linkedin.url"),"https://linkedin.com/shareArticle"+C({url:e,mini:"true",title:n,summary:r,source:a})}),(function(e){return{title:e.title,summary:e.summary,source:e.source}}),{windowWidth:750,windowHeight:600});const M={padding:"4px 10px",borderRadius:"5px"},J=e=>{let{url:t,title:n,tags:r}=e;return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"post-social"},a.a.createElement("h5",{className:"m-0 text-muted pr-2"},"Share:"),a.a.createElement(F,{style:M,url:t,className:"button is-outlined is-rounded facebook"},a.a.createElement("span",{className:"icon pr-2"},a.a.createElement("i",{className:"fab fa-facebook-square"})),a.a.createElement("span",{className:"text"},"Facebook")),a.a.createElement(X,{url:t,style:M,className:"button is-outlined is-rounded twitter",title:n,via:"reactgrid",hashtags:r},a.a.createElement("span",{className:"icon pr-2"},a.a.createElement("i",{className:"fab fa-twitter"})),a.a.createElement("span",{className:"text"},"Twitter")),a.a.createElement(G,{url:t,style:M,className:"button is-outlined is-rounded linkedin",title:n},a.a.createElement("span",{className:"icon pr-2"},a.a.createElement("i",{className:"fab fa-linkedin"})),a.a.createElement("span",{className:"text"},"LinkedIn"))))};n("jc/K");t.default=e=>{let{data:t}=e;Object(r.useEffect)(()=>(Object(p.a)()||(document.documentElement.scrollTop=0,document.scrollingElement.scrollTop=0),document.body.classList.add("blog-post"),()=>{document.body.classList.remove("blog-post")}),[]);const{mdx:n,site:u}=t,{title:m,description:f,pages:w,social:b,siteUrl:g}=u.siteMetadata,y=`${g}/blog${n.fields.slug}`;return a.a.createElement(o.a,{pages:w,social:b,description:f,title:m},a.a.createElement(i.a,{title:n.frontmatter.title,description:n.frontmatter.description||n.excerpt,canonicalUrl:n.frontmatter.canonicalUrl,meta:[{property:"og:image",content:g+n.frontmatter.thumbnail.childImageSharp.fluid.src},{property:"twitter:image",content:g+n.frontmatter.thumbnail.childImageSharp.fluid.src},{property:"twitter:card",content:"summary_large_image"},{property:"og:type",content:"article"}]}),a.a.createElement("div",{className:"blog-page-header header-large",style:{paddingTop:66}},a.a.createElement("div",{className:"page-header-image","data-parallax":!0,style:{backgroundImage:`url(${n.frontmatter.thumbnail.childImageSharp.fluid.base64})`}}),a.a.createElement(l.a,null,a.a.createElement(c.a,null,a.a.createElement(s.a,{className:"ml-auto mr-auto text-center",md:"8"},a.a.createElement("h1",{className:"title",style:{paddingBottom:30,lineHeight:"3rem"}},n.frontmatter.title),a.a.createElement("div",{className:"author"},a.a.createElement(d.a,{fluid:n.frontmatter.authorImg.childImageSharp.fluid,className:"avatar img-raised"})),a.a.createElement("h4",{className:"description",style:{paddingTop:30}},"Written by ",n.frontmatter.author),a.a.createElement("h4",{className:"description"},"on ",n.frontmatter.date),a.a.createElement(J,{tags:n.frontmatter.tags,title:n.frontmatter.title,url:y}))))),a.a.createElement("div",{className:"section"},a.a.createElement(l.a,null,a.a.createElement(c.a,null,a.a.createElement(s.a,{className:"ml-auto mr-auto",md:"11",lg:"8"},a.a.createElement("div",null,a.a.createElement(k,null,a.a.createElement(h.a,{scope:void 0,components:void 0},n.body))),a.a.createElement("hr",null),a.a.createElement(J,{tags:n.frontmatter.tags,title:n.frontmatter.title,url:y}))))))}},"jc/K":function(e,t,n){}}]);
//# sourceMappingURL=component---src-templates-blog-post-tsx-4cd075fddade7c193d8f.js.map