ikualo-ui-kit-mobile 2.0.7 → 2.0.9
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 +1 -1
- package/package.json +1 -1
- package/src/elements/dialogs/DialogDown.tsx +18 -6
package/app.json
CHANGED
package/package.json
CHANGED
|
@@ -34,10 +34,18 @@ class DialogManager {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
addDialog(dialog: DialogQueueItem) {
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
// Lógica de cierre del diálogo actual:
|
|
38
|
+
// 1. Si el nuevo NO tiene prioridad (0): cierra si el anterior tampoco tiene prioridad
|
|
39
|
+
// 2. Si el nuevo SÍ tiene prioridad (1-5): cierra si el anterior no tiene prioridad O si tiene prioridad menor o igual
|
|
40
|
+
if (this.currentDialog) {
|
|
41
|
+
const shouldCloseCurrent =
|
|
42
|
+
(dialog.priority === 0 && this.currentDialog.priority === 0) || // Ambos sin prioridad: cierra el anterior
|
|
43
|
+
(dialog.priority > 0 && this.currentDialog.priority === 0) || // Nuevo con prioridad, anterior sin: cierra
|
|
44
|
+
(dialog.priority > 0 && dialog.priority >= this.currentDialog.priority); // Ambos con prioridad: si nueva es mayor o igual
|
|
45
|
+
|
|
46
|
+
if (shouldCloseCurrent) {
|
|
47
|
+
this.closeCurrentDialog();
|
|
48
|
+
}
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
// Agregar a la cola
|
|
@@ -181,9 +189,11 @@ export const DialogDown = (props: IDialogDown & { priority?: 0 | 1 | 2 | 3 | 4 |
|
|
|
181
189
|
title,
|
|
182
190
|
dialogId,
|
|
183
191
|
currentDialogId: currentDialog?.id,
|
|
192
|
+
currentPriority: currentDialog?.priority,
|
|
193
|
+
newPriority: priority,
|
|
184
194
|
isCurrentDialog,
|
|
185
195
|
isVisible,
|
|
186
|
-
|
|
196
|
+
shouldShow: isCurrentDialog && isVisible,
|
|
187
197
|
});
|
|
188
198
|
|
|
189
199
|
return (
|
|
@@ -224,7 +234,9 @@ export const DialogDown = (props: IDialogDown & { priority?: 0 | 1 | 2 | 3 | 4 |
|
|
|
224
234
|
<View style={stylesDialog['dialog-img']}>{image}</View>
|
|
225
235
|
) : (
|
|
226
236
|
<View style={{ marginTop: image ? 0 : -16, position: 'relative' }}>
|
|
227
|
-
<Text style={[stylesDialog['dialog-title']]}>
|
|
237
|
+
<Text style={[stylesDialog['dialog-title'], { fontSize: showCloseButton ? 16 : 24 }]}>
|
|
238
|
+
{title}
|
|
239
|
+
</Text>
|
|
228
240
|
</View>
|
|
229
241
|
)}
|
|
230
242
|
|