@mailstep/design-system 0.6.15 → 0.6.16

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.
@@ -0,0 +1,3 @@
1
+ export declare const useCheckDeviceWidth: () => {
2
+ isMobile: boolean;
3
+ };
@@ -0,0 +1,17 @@
1
+ import { useEffect, useState } from 'react';
2
+ export var useCheckDeviceWidth = function () {
3
+ var _a = useState(false), isMobile = _a[0], setIsMobile = _a[1];
4
+ useEffect(function () {
5
+ var handleResize = function () {
6
+ if (window.innerWidth < 1024) {
7
+ setIsMobile === null || setIsMobile === void 0 ? void 0 : setIsMobile(true);
8
+ }
9
+ else
10
+ setIsMobile(false);
11
+ };
12
+ window.addEventListener('resize', handleResize);
13
+ handleResize();
14
+ return function () { return window.removeEventListener('resize', handleResize); };
15
+ }, []);
16
+ return { isMobile: isMobile };
17
+ };