react-screentype-hook
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-screentype-hook"]=t(require("react")):e["react-screentype-hook"]=t(e.react)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){e.exports=r(2)()},function(t,r){t.exports=e},function(e,t,r){"use strict";var n=r(3);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,s){if(s!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r(0);const i={largeDesktop:1440,desktop:992,tablet:768,mobile:320},s="MOBILE",a="TABLET",p="DESKTOP",c="LARGE_DESKTOP",u=e=>({isMobile:e===s,isTablet:e===a,isDesktop:e===p,isLargeDesktop:e===c});function d(e=i){const[t,r]=Object(n.useState)(u(e)),o=e=>t=>t.matches&&r(u(e));return Object(n.useEffect)(()=>{r((e=>({isMobile:window.innerWidth<e.tablet,isTablet:window.innerWidth>=e.tablet&&window.innerWidth<e.desktop,isDesktop:window.innerWidth>=e.desktop&&window.innerWidth<e.largeDesktop,isLargeDesktop:window.innerWidth>=e.largeDesktop}))(e));const t=matchMedia(`(min-width: ${e.largeDesktop}px)`),n=matchMedia(`(min-width: ${e.desktop}px) and (max-width: ${e.largeDesktop-1}px)`),i=matchMedia(`(min-width: ${e.tablet}px) and (max-width: ${e.desktop-1}px)`),u=matchMedia(`(max-width: ${e.tablet}px)`);return u.addListener(o(s)),i.addListener(o(a)),n.addListener(o(p)),t.addListener(o(c)),()=>{u.removeListener(o(s)),i.removeListener(o(a)),n.removeListener(o(p)),t.removeListener(o(c))}},[e]),t}d.propTypes={breakpoints:o.PropTypes.shape({isMobile:o.PropTypes.bool,isTablet:o.PropTypes.bool,isDesktop:o.PropTypes.bool})};var f=d;r.d(t,"default",(function(){return f}))}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-screentype-hook"]=t(require("react")):e["react-screentype-hook"]=t(e.react)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){e.exports=r(2)()},function(t,r){t.exports=e},function(e,t,r){"use strict";var n=r(3);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,s){if(s!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r(0);const i={largeDesktop:1440,desktop:992,tablet:768,mobile:320},s="MOBILE",a="TABLET",p="DESKTOP",c="LARGE_DESKTOP",u=e=>({isMobile:e===s,isTablet:e===a,isDesktop:e===p,isLargeDesktop:e===c});function d(e=i){const[t,r]=Object(n.useState)(u(e)),o=e=>t=>t.matches&&r(u(e));return Object(n.useEffect)(()=>{r((e=>({isMobile:window.innerWidth<e.tablet,isTablet:window.innerWidth>=e.tablet&&window.innerWidth<e.desktop,isDesktop:window.innerWidth>=e.desktop&&window.innerWidth<e.largeDesktop,isLargeDesktop:window.innerWidth>=e.largeDesktop}))(e));const t=matchMedia(`(min-width: ${e.largeDesktop}px)`),n=matchMedia(`(min-width: ${e.desktop}px) and (max-width: ${e.largeDesktop-1}px)`),i=matchMedia(`(min-width: ${e.tablet}px) and (max-width: ${e.desktop-1}px)`),u=matchMedia(`(max-width: ${e.tablet}px)`);return u.addListener(o(s)),i.addListener(o(a)),n.addListener(o(p)),t.addListener(o(c)),()=>{u.removeListener(o(s)),i.removeListener(o(a)),n.removeListener(o(p)),t.removeListener(o(c))}},[]),t}d.propTypes={breakpoints:o.PropTypes.shape({isMobile:o.PropTypes.bool,isTablet:o.PropTypes.bool,isDesktop:o.PropTypes.bool})};var f=d;r.d(t,"default",(function(){return f}))}])})); |
{ | ||
"name": "react-screentype-hook", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "react-screentype-hook", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -50,3 +50,3 @@ import { useState, useEffect } from "react"; | ||
}; | ||
}, [breakpoints]); | ||
}, []); | ||
return screenType; | ||
@@ -53,0 +53,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13197