react-favic
Version:
Add Favicons to the head of your React app
2 lines (1 loc) • 3.03 kB
JavaScript
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):e.reactFavic=n(e.react)}(this,function(e){function n(){return(n=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}e=e&&e.hasOwnProperty("default")?e.default:e;var t=function(t){var a=t.href;return(0,t.onRender)([{rel:"apple-touch-icon-precomposed",sizes:"57x57",name:"apple-touch-icon-57x57.png",tag:"link"},{rel:"apple-touch-icon-precomposed",sizes:"60x60",name:"apple-touch-icon-60x60.png",tag:"link"},{rel:"apple-touch-icon-precomposed",sizes:"72x72",name:"apple-touch-icon-72x72.png",tag:"link"},{rel:"apple-touch-icon-precomposed",sizes:"76x76",name:"apple-touch-icon-76x76.png",tag:"link"},{rel:"apple-touch-icon-precomposed",sizes:"114x114",name:"apple-touch-icon-114x114.png",tag:"link"},{rel:"apple-touch-icon-precomposed",sizes:"120x120",name:"apple-touch-icon-120x120.png",tag:"link"},{rel:"apple-touch-icon-precomposed",sizes:"144x144",name:"apple-touch-icon-144x144.png",tag:"link"},{rel:"apple-touch-icon-precomposed",sizes:"152x152",name:"apple-touch-icon-152x152.png",tag:"link"},{rel:"icon",sizes:"16x16",type:"image/png",name:"favicon-16x16.png",tag:"link"},{rel:"icon",sizes:"32x32",type:"image/png",name:"favicon-32x32.png",tag:"link"},{rel:"icon",sizes:"96x96",type:"image/png",name:"favicon-96x96.png",tag:"link"},{rel:"icon",sizes:"128x128",type:"image/png",name:"favicon-128.png",tag:"link"},{rel:"icon",sizes:"128x128",type:"image/png",name:"favicon-128x128.png",tag:"link"},{rel:"icon",sizes:"196x196",type:"image/png",name:"favicon-196x196.png",tag:"link"},{tag:"meta",name:"application-name",content:t.name},{tag:"meta",name:"msapplication-TileColor",content:t.color},{tag:"meta",name:"msapplication-TileImage",content:"".concat(a,"/mstile-144x144.png")},{tag:"meta",name:"msapplication-square70x70logo",content:"".concat(a,"/mstile-70x70.png")},{tag:"meta",name:"msapplication-square150x150logo",content:"".concat(a,"/mstile-150x150.png")},{tag:"meta",name:"msapplication-wide310x150logo",content:"".concat(a,"/mstile-310x150.png")},{tag:"meta",name:"msapplication-square310x310logo",content:"".concat(a,"/mstile-310x310.png")}]).map(function(t){var o=t.tag,p=t.name,i=function(e,n){if(null==e)return{};var t,a,o=function(e,n){if(null==e)return{};var t,a,o={},p=Object.keys(e);for(a=0;a<p.length;a++)n.indexOf(t=p[a])>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(a=0;a<p.length;a++)n.indexOf(t=p[a])>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(t,["tag","name"]);return"meta"===o?e.createElement("meta",n({key:p,name:p},i)):"link"===o?e.createElement("link",n({key:p,href:"".concat(a,"/").concat(p)},i)):null})};return t.defaultProps={href:"/static",name:"App",color:"#fff",onRender:function(e){return e}},t});