Преглед на файлове

ref(mobile): display only the topmost notification

Only one notification will be displayed at a time on mobile.
master
paweldomas преди 6 години
родител
ревизия
0175690a2b
променени са 1 файла, в които са добавени 9 реда и са изтрити 10 реда
  1. 9
    10
      react/features/notifications/components/NotificationsContainer.native.js

+ 9
- 10
react/features/notifications/components/NotificationsContainer.native.js Целия файл

37
     render() {
37
     render() {
38
         const { _notifications } = this.props;
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
             return null;
45
             return null;
42
         }
46
         }
43
 
47
 
48
                     styles.notificationContainer,
52
                     styles.notificationContainer,
49
                     this.props.style
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
             </View>
59
             </View>
61
         );
60
         );
62
     }
61
     }

Loading…
Отказ
Запис