Explorar el Código

ref(mobile): display only the topmost notification

Only one notification will be displayed at a time on mobile.
master
paweldomas hace 6 años
padre
commit
0175690a2b

+ 9
- 10
react/features/notifications/components/NotificationsContainer.native.js Ver fichero

@@ -37,7 +37,11 @@ class NotificationsContainer
37 37
     render() {
38 38
         const { _notifications } = this.props;
39 39
 
40
-        if (!_notifications || !_notifications.length) {
40
+        // Currently the native container displays only the topmost notification
41
+        const theNotification
42
+            = _notifications && _notifications.length && _notifications[0];
43
+
44
+        if (!theNotification) {
41 45
             return null;
42 46
         }
43 47
 
@@ -48,15 +52,10 @@ class NotificationsContainer
48 52
                     styles.notificationContainer,
49 53
                     this.props.style
50 54
                 ] } >
51
-                {
52
-                    _notifications.map(
53
-                        ({ props, uid }) => (
54
-                            <Notification
55
-                                { ...props }
56
-                                key = { uid }
57
-                                onDismissed = { this._onDismissed }
58
-                                uid = { uid } />))
59
-                }
55
+                <Notification
56
+                    { ...theNotification.props }
57
+                    onDismissed = { this._onDismissed }
58
+                    uid = { theNotification.uid } />
60 59
             </View>
61 60
         );
62 61
     }

Loading…
Cancelar
Guardar