@headless-adminapp/app 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,2 @@
1
1
  export declare function useIsMobile(): boolean;
2
+ export declare function useIsTablet(): boolean;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useIsMobile = useIsMobile;
7
+ exports.useIsTablet = useIsTablet;
7
8
  const debounce_1 = __importDefault(require("lodash/debounce"));
8
9
  const react_1 = require("react");
9
10
  function useIsMobile() {
@@ -18,3 +19,15 @@ function useIsMobile() {
18
19
  }, []);
19
20
  return isMobile;
20
21
  }
22
+ function useIsTablet() {
23
+ const [isTablet, setIsTablet] = (0, react_1.useState)(false);
24
+ (0, react_1.useLayoutEffect)(() => {
25
+ const updateSize = () => {
26
+ setIsTablet(window.innerWidth < 1024);
27
+ };
28
+ window.addEventListener('resize', (0, debounce_1.default)(updateSize, 250));
29
+ updateSize();
30
+ return () => window.removeEventListener('resize', updateSize);
31
+ }, []);
32
+ return isTablet;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/app",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -36,5 +36,5 @@
36
36
  "uuid": "11.0.3",
37
37
  "yup": "^1.4.0"
38
38
  },
39
- "gitHead": "918b655a582c5c63864e8bbe6999289ec959b917"
39
+ "gitHead": "5ee9022d0e1bc4c75ef4777a4cfbd4557ae34a99"
40
40
  }
@@ -114,7 +114,7 @@ function useRetriveRecordsInternal(queryKey, { columns, expand, filter, maxRecor
114
114
  queryKey,
115
115
  })
116
116
  .catch(console.error);
117
- }, []);
117
+ }, [queryClient, queryKey]);
118
118
  return {
119
119
  data: finalData,
120
120
  isFetching,