cdslibrary 1.0.36 → 1.0.37
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.
- package/components/CDSButton.jsx +4 -7
- package/package.json +1 -1
package/components/CDSButton.jsx
CHANGED
|
@@ -41,15 +41,12 @@ export const CDSButton = ({
|
|
|
41
41
|
// Efecto para detectar cambios en el tamaño de la ventana en la web
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
const handleResize = () => {
|
|
44
|
-
|
|
44
|
+
const { width } = Dimensions.get("window");
|
|
45
|
+
setIsMobile(width <= 768);
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return () => {
|
|
50
|
-
window.removeEventListener('resize', handleResize);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
48
|
+
const subscription = Dimensions.addEventListener("change", handleResize);
|
|
49
|
+
return () => subscription?.remove(); // Limpia el listener
|
|
53
50
|
}, []);
|
|
54
51
|
|
|
55
52
|
return (
|