react-screentype-hook
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -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))}},[]),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 n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(2)()},function(e,t,n){"use strict";var r=n(3);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={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 n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(0);n(1);const o={largeDesktop:1440,desktop:992,tablet:768,mobile:320},i="MOBILE",a="TABLET",s="DESKTOP",c="LARGE_DESKTOP",p=e=>({isMobile:e===i,isTablet:e===a,isDesktop:e===s,isLargeDesktop:e===c});var u=function(e=o){const[t,n]=Object(r.useState)(p(e)),u=e=>t=>t.matches&&n(p(e));return Object(r.useEffect)(()=>{n((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)`),r=matchMedia(`(min-width: ${e.desktop}px) and (max-width: ${e.largeDesktop-1}px)`),o=matchMedia(`(min-width: ${e.tablet}px) and (max-width: ${e.desktop-1}px)`),p=matchMedia(`(max-width: ${e.tablet}px)`);return p.addListener(u(i)),o.addListener(u(a)),r.addListener(u(s)),t.addListener(u(c)),()=>{p.removeListener(u(i)),o.removeListener(u(a)),r.removeListener(u(s)),t.removeListener(u(c))}},[]),t};n.d(t,"default",(function(){return u}))}])})); |
{ | ||
"name": "react-screentype-hook", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "react-screentype-hook", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -54,9 +54,2 @@ import { useState, useEffect } from "react"; | ||
useScreenType.propTypes = { | ||
breakpoints: PropTypes.shape({ | ||
isMobile: PropTypes.bool, | ||
isTablet: PropTypes.bool, | ||
isDesktop: PropTypes.bool | ||
}) | ||
}; | ||
export default useScreenType; |
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
12907
162