ikualo-ui-kit-mobile 2.1.18 → 2.1.19

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/app.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "ikualo-app-2.0",
4
4
  "slug": "ikualo-app-20",
5
5
  "owner": "ikualo",
6
- "version": "2.1.17",
6
+ "version": "2.1.19",
7
7
  "orientation": "portrait",
8
8
  "icon": "./assets/icon.png",
9
9
  "userInterfaceStyle": "automatic",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ikualo-ui-kit-mobile",
3
- "version": "2.1.18",
3
+ "version": "2.1.19",
4
4
  "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "start": "expo start",
@@ -9,6 +9,7 @@ import {
9
9
  Animated,
10
10
  BackHandler,
11
11
  Platform,
12
+ InteractionManager,
12
13
  } from 'react-native';
13
14
  import { useEffect, useState, useRef } from 'react';
14
15
  import useStore from '../../store';
@@ -74,6 +75,7 @@ export const DialogDown = (props: IDialogDown & { priority?: 0 | 1 | 2 | 3 | 4 |
74
75
  const { isVisible, title, children, onDismiss, image, showCloseButton = true, priority = 0, id } = props;
75
76
  const slideAnim = useRef(new Animated.Value(0)).current;
76
77
  const [currentDialog, setCurrentDialog] = useState<{ id: string; priority: number } | null>(null);
78
+ const [isAnimationReady, setIsAnimationReady] = useState(false);
77
79
  const [dialogId] = useState(() => {
78
80
  // Si se proporciona un id, usarlo. Si no, generar uno aleatorio
79
81
  return id || Math.random().toString(36).substring(2, 11);
@@ -112,17 +114,32 @@ export const DialogDown = (props: IDialogDown & { priority?: 0 | 1 | 2 | 3 | 4 |
112
114
  };
113
115
  }, [dialogId]);
114
116
 
115
- // Animación basada en si este diálogo es el actual
116
117
  useEffect(() => {
117
118
  const isCurrentDialog = currentDialog?.id === dialogId;
118
119
  if (isCurrentDialog) {
119
- Animated.timing(slideAnim, {
120
- toValue: 1,
121
- duration: 300,
122
- useNativeDriver: true,
123
- }).start();
120
+ setIsAnimationReady(false);
121
+ slideAnim.setValue(0);
122
+ const handle = InteractionManager.runAfterInteractions(() => {
123
+ requestAnimationFrame(() => {
124
+ requestAnimationFrame(() => {
125
+ if (currentDialog?.id === dialogId) {
126
+ setIsAnimationReady(true);
127
+ Animated.timing(slideAnim, {
128
+ toValue: 1,
129
+ duration: 300,
130
+ useNativeDriver: true,
131
+ }).start();
132
+ }
133
+ });
134
+ });
135
+ });
136
+
137
+ return () => {
138
+ handle.cancel();
139
+ };
124
140
  } else {
125
141
  slideAnim.setValue(0);
142
+ setIsAnimationReady(false);
126
143
  }
127
144
  }, [currentDialog, slideAnim, dialogId]);
128
145
 
@@ -185,6 +202,7 @@ export const DialogDown = (props: IDialogDown & { priority?: 0 | 1 | 2 | 3 | 4 |
185
202
  }),
186
203
  },
187
204
  ],
205
+ opacity: isAnimationReady ? 1 : 0,
188
206
  },
189
207
  ]}
190
208
  >