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.
@@ -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
- setIsMobile(window.innerWidth <= 768); // Ajusta el umbral según lo necesites
44
+ const { width } = Dimensions.get("window");
45
+ setIsMobile(width <= 768);
45
46
  };
46
47
 
47
- if (Platform.OS === 'web') {
48
- window.addEventListener('resize', handleResize);
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 (
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdslibrary",
3
3
  "license": "0BSD",
4
- "version": "1.0.36",
4
+ "version": "1.0.37",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",