Pārlūkot izejas kodu

ref(NotificationsContainer.native): simplify

The outer container is not necessary if 'justifyContent: flex-end' is
used with the absolute fill on the main container.
master
paweldomas 7 gadus atpakaļ
vecāks
revīzija
5119f41af6

+ 20
- 23
react/features/notifications/components/NotificationsContainer.native.js Parādīt failu

@@ -8,6 +8,7 @@ import {
8 8
     isNarrowAspectRatio,
9 9
     makeAspectRatioAware
10 10
 } from '../../base/responsive-ui';
11
+import { BoxModel } from '../../base/styles';
11 12
 import { FILMSTRIP_SIZE, isFilmstripVisible } from '../../filmstrip';
12 13
 import { HANGUP_BUTTON_SIZE } from '../../toolbox';
13 14
 
@@ -34,7 +35,7 @@ type Props = AbstractProps & {
34 35
 /**
35 36
  * The margin of the container to be kept from other components.
36 37
  */
37
-const CONTAINER_MARGIN = 10;
38
+const CONTAINER_MARGIN = BoxModel.margin;
38 39
 
39 40
 /**
40 41
  * Implements a React {@link Component} which displays notifications and handles
@@ -61,28 +62,24 @@ class NotificationsContainer extends AbstractNotificationsContainer<Props> {
61 62
         return (
62 63
             <View
63 64
                 pointerEvents = 'box-none'
64
-                style = { styles.notificationOverlay }>
65
-                <View
66
-                    pointerEvents = 'box-none'
67
-                    style = { [
68
-                        styles.notificationContainer,
69
-                        this._getContainerStyle()
70
-                    ] }>
71
-                    {
72
-                        _notifications.map(notification => {
73
-                            const { props, uid } = notification;
74
-
75
-                            return (
76
-                                <Notification
77
-                                    { ...props }
78
-                                    key = { uid }
79
-                                    onDismissed = { this._onDismissed }
80
-                                    uid = { uid } />
81
-
82
-                            );
83
-                        })
84
-                    }
85
-                </View>
65
+                style = { [
66
+                    styles.notificationContainer,
67
+                    this._getContainerStyle()
68
+                ] }>
69
+                {
70
+                    _notifications.map(notification => {
71
+                        const { props, uid } = notification;
72
+
73
+                        return (
74
+                            <Notification
75
+                                { ...props }
76
+                                key = { uid }
77
+                                onDismissed = { this._onDismissed }
78
+                                uid = { uid } />
79
+
80
+                        );
81
+                    })
82
+                }
86 83
             </View>
87 84
         );
88 85
     }

+ 3
- 13
react/features/notifications/components/styles.js Parādīt failu

@@ -48,12 +48,9 @@ export default createStyleSheet({
48 48
      * Outermost container of a list of notifications.
49 49
      */
50 50
     notificationContainer: {
51
-        alignItems: 'flex-start',
52
-        bottom: 0,
53
-        left: 0,
54
-        padding: 2 * BoxModel.padding,
55
-        position: 'absolute',
56
-        right: 0
51
+        ...StyleSheet.absoluteFillObject,
52
+        justifyContent: 'flex-end',
53
+        padding: 2 * BoxModel.padding
57 54
     },
58 55
 
59 56
     /**
@@ -64,13 +61,6 @@ export default createStyleSheet({
64 61
         paddingVertical: 0.5 * BoxModel.padding
65 62
     },
66 63
 
67
-    /**
68
-     * A full screen overlay to help to position the container.
69
-     */
70
-    notificationOverlay: {
71
-        ...StyleSheet.absoluteFillObject
72
-    },
73
-
74 64
     /**
75 65
      * The View containing the title.
76 66
      */

Notiek ielāde…
Atcelt
Saglabāt