react-favic
Version:
Add Favicons to the head of your React app
2 lines (1 loc) • 2.86 kB
JavaScript
var e,n=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e;function a(){return(a=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e}).apply(this,arguments)}var t=function(e){var t=e.href;return(0,e.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:e.name},{tag:"meta",name:"msapplication-TileColor",content:e.color},{tag:"meta",name:"msapplication-TileImage",content:"".concat(t,"/mstile-144x144.png")},{tag:"meta",name:"msapplication-square70x70logo",content:"".concat(t,"/mstile-70x70.png")},{tag:"meta",name:"msapplication-square150x150logo",content:"".concat(t,"/mstile-150x150.png")},{tag:"meta",name:"msapplication-wide310x150logo",content:"".concat(t,"/mstile-310x150.png")},{tag:"meta",name:"msapplication-square310x310logo",content:"".concat(t,"/mstile-310x310.png")}]).map(function(e){var o=e.tag,p=e.name,i=function(e,n){if(null==e)return{};var a,t,o=function(e,n){if(null==e)return{};var a,t,o={},p=Object.keys(e);for(t=0;t<p.length;t++)n.indexOf(a=p[t])>=0||(o[a]=e[a]);return o}(e,n);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(t=0;t<p.length;t++)n.indexOf(a=p[t])>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}(e,["tag","name"]);return"meta"===o?n.createElement("meta",a({key:p,name:p},i)):"link"===o?n.createElement("link",a({key:p,href:"".concat(t,"/").concat(p)},i)):null})};t.defaultProps={href:"/static",name:"App",color:"#fff",onRender:function(e){return e}},module.exports=t;