Преглед изворни кода

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
                         _shouldDisplayTileView
436
                         _shouldDisplayTileView
437
                         || <>
437
                         || <>
438
                             <Filmstrip />
438
                             <Filmstrip />
439
+                            { this._renderNotificationsContainer() }
439
                             <Toolbox />
440
                             <Toolbox />
440
                         </>
441
                         </>
441
                     }
442
                     }
467
                         {/* eslint-disable-next-line react/jsx-no-bind */}
468
                         {/* eslint-disable-next-line react/jsx-no-bind */}
468
                         <AlwaysOnLabels createOnPress = { this._createOnPress } />
469
                         <AlwaysOnLabels createOnPress = { this._createOnPress } />
469
                     </View>
470
                     </View>
470
-                    { this._renderNotificationsContainer() }
471
                 </SafeAreaView>
471
                 </SafeAreaView>
472
 
472
 
473
                 <TestConnectionInfo />
473
                 <TestConnectionInfo />
530
 
530
 
531
         return super.renderNotificationsContainer(
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
 import { connect } from '../../../base/redux';
9
 import { connect } from '../../../base/redux';
10
 import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
10
 import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
11
 import { getHideSelfView } from '../../../base/settings/functions.any';
11
 import { getHideSelfView } from '../../../base/settings/functions.any';
12
+import { areThereNotifications } from '../../../notifications/functions';
12
 import { isToolboxVisible } from '../../../toolbox/functions';
13
 import { isToolboxVisible } from '../../../toolbox/functions';
13
 import { setVisibleRemoteParticipants } from '../../actions';
14
 import { setVisibleRemoteParticipants } from '../../actions';
14
 import {
15
 import {
16
     isFilmstripVisible,
17
     isFilmstripVisible,
17
     shouldDisplayLocalThumbnailSeparately,
18
     shouldDisplayLocalThumbnailSeparately,
18
     shouldRemoteVideosBeVisible
19
     shouldRemoteVideosBeVisible
19
-} from '../../functions';
20
+} from '../../functions.native';
20
 
21
 
21
 import LocalThumbnail from './LocalThumbnail';
22
 import LocalThumbnail from './LocalThumbnail';
22
 import Thumbnail from './Thumbnail';
23
 import Thumbnail from './Thumbnail';
23
 import styles from './styles';
24
 import styles from './styles';
24
 
25
 
26
+
25
 // Immutable reference to avoid re-renders.
27
 // Immutable reference to avoid re-renders.
26
 const NO_REMOTE_VIDEOS = [];
28
 const NO_REMOTE_VIDEOS = [];
27
 
29
 
51
 
53
 
52
     _localParticipantId: string,
54
     _localParticipantId: string,
53
 
55
 
56
+    _notificationsAvailable: boolean,
57
+
54
     /**
58
     /**
55
      * The participants in the conference.
59
      * The participants in the conference.
56
      */
60
      */
248
             _disableSelfView,
252
             _disableSelfView,
249
             _toolboxVisible,
253
             _toolboxVisible,
250
             _localParticipantId,
254
             _localParticipantId,
255
+            _notificationsAvailable,
251
             _participants,
256
             _participants,
252
             _visible
257
             _visible
253
         } = this.props;
258
         } = this.props;
256
             return null;
261
             return null;
257
         }
262
         }
258
 
263
 
259
-        const bottomEdge = Platform.OS === 'ios' && !_toolboxVisible;
264
+        const bottomEdge = Platform.OS === 'ios' && !_toolboxVisible && !_notificationsAvailable;
260
         const isNarrowAspectRatio = _aspectRatio === ASPECT_RATIO_NARROW;
265
         const isNarrowAspectRatio = _aspectRatio === ASPECT_RATIO_NARROW;
261
         const filmstripStyle = isNarrowAspectRatio ? styles.filmstripNarrow : styles.filmstripWide;
266
         const filmstripStyle = isNarrowAspectRatio ? styles.filmstripNarrow : styles.filmstripWide;
262
         const { height, width } = this._getDimensions();
267
         const { height, width } = this._getDimensions();
330
         _clientWidth: responsiveUI.clientWidth,
335
         _clientWidth: responsiveUI.clientWidth,
331
         _disableSelfView: disableSelfView,
336
         _disableSelfView: disableSelfView,
332
         _localParticipantId: getLocalParticipant(state)?.id,
337
         _localParticipantId: getLocalParticipant(state)?.id,
338
+        _notificationsAvailable: areThereNotifications(state),
333
         _participants: showRemoteVideos ? remoteParticipants : NO_REMOTE_VIDEOS,
339
         _participants: showRemoteVideos ? remoteParticipants : NO_REMOTE_VIDEOS,
334
         _toolboxVisible: isToolboxVisible(state),
340
         _toolboxVisible: isToolboxVisible(state),
335
         _visible: enabled && isFilmstripVisible(state)
341
         _visible: enabled && isFilmstripVisible(state)

+ 10
- 4
react/features/notifications/components/native/NotificationsContainer.js Прегледај датотеку

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
+import { Platform } from 'react-native';
5
+import { SafeAreaView } from 'react-native-safe-area-context';
4
 
6
 
5
 import { connect } from '../../../base/redux';
7
 import { connect } from '../../../base/redux';
6
 import { hideNotification } from '../../actions';
8
 import { hideNotification } from '../../actions';
20
     /**
22
     /**
21
      * Invoked to update the redux store in order to remove notifications.
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
      * @inheritdoc
169
      * @inheritdoc
166
      */
170
      */
167
     render() {
171
     render() {
168
-        const { _notifications } = this.props;
172
+        const { _notifications, toolboxVisible } = this.props;
173
+        const bottomEdge = Platform.OS === 'ios' && !toolboxVisible;
169
 
174
 
170
         return (
175
         return (
171
-            <>
176
+            <SafeAreaView
177
+                edges = { [ bottomEdge && 'bottom', 'left', 'right' ].filter(Boolean) }>
172
                 {
178
                 {
173
                     _notifications.map((notification, index) => {
179
                     _notifications.map((notification, index) => {
174
                         const { props, uid } = notification;
180
                         const { props, uid } = notification;
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
     flexDirection: 'row',
17
     flexDirection: 'row',
18
     maxHeight: 104,
18
     maxHeight: 104,
19
     height: 'auto',
19
     height: 'auto',
20
-    marginBottom: BaseTheme.spacing[3],
20
+    marginBottom: BaseTheme.spacing[2],
21
     marginHorizontal: BaseTheme.spacing[2],
21
     marginHorizontal: BaseTheme.spacing[2],
22
     maxWidth: 400,
22
     maxWidth: 400,
23
     width: 'auto'
23
     width: 'auto'

Loading…
Откажи
Сачувај