浏览代码

feat(notifications): moved notifications to the bottom of the screen

factor2
Calin-Teodor 2 年前
父节点
当前提交
e405595a11

+ 3
- 2
react/features/conference/components/native/Conference.js 查看文件

@@ -436,6 +436,7 @@ class Conference extends AbstractConference<Props, State> {
436 436
                         _shouldDisplayTileView
437 437
                         || <>
438 438
                             <Filmstrip />
439
+                            { this._renderNotificationsContainer() }
439 440
                             <Toolbox />
440 441
                         </>
441 442
                     }
@@ -467,7 +468,6 @@ class Conference extends AbstractConference<Props, State> {
467 468
                         {/* eslint-disable-next-line react/jsx-no-bind */}
468 469
                         <AlwaysOnLabels createOnPress = { this._createOnPress } />
469 470
                     </View>
470
-                    { this._renderNotificationsContainer() }
471 471
                 </SafeAreaView>
472 472
 
473 473
                 <TestConnectionInfo />
@@ -530,7 +530,8 @@ class Conference extends AbstractConference<Props, State> {
530 530
 
531 531
         return super.renderNotificationsContainer(
532 532
             {
533
-                style: notificationsStyle
533
+                style: notificationsStyle,
534
+                toolboxVisible: this.props._toolboxVisible
534 535
             }
535 536
         );
536 537
     }

+ 8
- 2
react/features/filmstrip/components/native/Filmstrip.js 查看文件

@@ -9,6 +9,7 @@ import { Platform } from '../../../base/react';
9 9
 import { connect } from '../../../base/redux';
10 10
 import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
11 11
 import { getHideSelfView } from '../../../base/settings/functions.any';
12
+import { areThereNotifications } from '../../../notifications/functions';
12 13
 import { isToolboxVisible } from '../../../toolbox/functions';
13 14
 import { setVisibleRemoteParticipants } from '../../actions';
14 15
 import {
@@ -16,12 +17,13 @@ import {
16 17
     isFilmstripVisible,
17 18
     shouldDisplayLocalThumbnailSeparately,
18 19
     shouldRemoteVideosBeVisible
19
-} from '../../functions';
20
+} from '../../functions.native';
20 21
 
21 22
 import LocalThumbnail from './LocalThumbnail';
22 23
 import Thumbnail from './Thumbnail';
23 24
 import styles from './styles';
24 25
 
26
+
25 27
 // Immutable reference to avoid re-renders.
26 28
 const NO_REMOTE_VIDEOS = [];
27 29
 
@@ -51,6 +53,8 @@ type Props = {
51 53
 
52 54
     _localParticipantId: string,
53 55
 
56
+    _notificationsAvailable: boolean,
57
+
54 58
     /**
55 59
      * The participants in the conference.
56 60
      */
@@ -248,6 +252,7 @@ class Filmstrip extends PureComponent<Props> {
248 252
             _disableSelfView,
249 253
             _toolboxVisible,
250 254
             _localParticipantId,
255
+            _notificationsAvailable,
251 256
             _participants,
252 257
             _visible
253 258
         } = this.props;
@@ -256,7 +261,7 @@ class Filmstrip extends PureComponent<Props> {
256 261
             return null;
257 262
         }
258 263
 
259
-        const bottomEdge = Platform.OS === 'ios' && !_toolboxVisible;
264
+        const bottomEdge = Platform.OS === 'ios' && !_toolboxVisible && !_notificationsAvailable;
260 265
         const isNarrowAspectRatio = _aspectRatio === ASPECT_RATIO_NARROW;
261 266
         const filmstripStyle = isNarrowAspectRatio ? styles.filmstripNarrow : styles.filmstripWide;
262 267
         const { height, width } = this._getDimensions();
@@ -330,6 +335,7 @@ function _mapStateToProps(state) {
330 335
         _clientWidth: responsiveUI.clientWidth,
331 336
         _disableSelfView: disableSelfView,
332 337
         _localParticipantId: getLocalParticipant(state)?.id,
338
+        _notificationsAvailable: areThereNotifications(state),
333 339
         _participants: showRemoteVideos ? remoteParticipants : NO_REMOTE_VIDEOS,
334 340
         _toolboxVisible: isToolboxVisible(state),
335 341
         _visible: enabled && isFilmstripVisible(state)

+ 10
- 4
react/features/notifications/components/native/NotificationsContainer.js 查看文件

@@ -1,6 +1,8 @@
1 1
 // @flow
2 2
 
3 3
 import React, { Component } from 'react';
4
+import { Platform } from 'react-native';
5
+import { SafeAreaView } from 'react-native-safe-area-context';
4 6
 
5 7
 import { connect } from '../../../base/redux';
6 8
 import { hideNotification } from '../../actions';
@@ -20,7 +22,9 @@ type Props = {
20 22
     /**
21 23
      * Invoked to update the redux store in order to remove notifications.
22 24
      */
23
-     dispatch: Function
25
+     dispatch: Function,
26
+
27
+     toolboxVisible: boolean
24 28
 };
25 29
 
26 30
 /**
@@ -165,10 +169,12 @@ class NotificationsContainer extends Component<Props> {
165 169
      * @inheritdoc
166 170
      */
167 171
     render() {
168
-        const { _notifications } = this.props;
172
+        const { _notifications, toolboxVisible } = this.props;
173
+        const bottomEdge = Platform.OS === 'ios' && !toolboxVisible;
169 174
 
170 175
         return (
171
-            <>
176
+            <SafeAreaView
177
+                edges = { [ bottomEdge && 'bottom', 'left', 'right' ].filter(Boolean) }>
172 178
                 {
173 179
                     _notifications.map((notification, index) => {
174 180
                         const { props, uid } = notification;
@@ -182,7 +188,7 @@ class NotificationsContainer extends Component<Props> {
182 188
                         );
183 189
                     })
184 190
                 }
185
-            </>
191
+            </SafeAreaView>
186 192
         );
187 193
     }
188 194
 

+ 1
- 1
react/features/notifications/components/native/styles.js 查看文件

@@ -17,7 +17,7 @@ const notification = {
17 17
     flexDirection: 'row',
18 18
     maxHeight: 104,
19 19
     height: 'auto',
20
-    marginBottom: BaseTheme.spacing[3],
20
+    marginBottom: BaseTheme.spacing[2],
21 21
     marginHorizontal: BaseTheme.spacing[2],
22 22
     maxWidth: 400,
23 23
     width: 'auto'

正在加载...
取消
保存