cdslibrary 1.0.36 → 1.0.38

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 (
@@ -62,7 +59,7 @@ export const CDSButton = ({
62
59
  flexend && { justifyContent: "flex-end", paddingHorizontal: 0 },
63
60
  {
64
61
  paddingHorizontal: type === "icon" ? 12 : 24,
65
- ...(isMobile && { width: "100%" }) // Se aplica full width si es móvil o en la web en modo móvil
62
+ // ...(isMobile && { width: "100%" })
66
63
  },
67
64
  type === "secondary" && {
68
65
  borderColor: theme.outline.action.primary,
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.38",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",