Pārlūkot izejas kodu

[RN] Remove mobile notifications

j8
Bettenbuk Zoltan 7 gadus atpakaļ
vecāks
revīzija
60f7ba7301

+ 1
- 36
react/features/conference/components/Conference.native.js Parādīt failu

@@ -11,21 +11,18 @@ import { connect, disconnect } from '../../base/connection';
11 11
 import { getParticipantCount } from '../../base/participants';
12 12
 import { Container, LoadingIndicator, TintedView } from '../../base/react';
13 13
 import {
14
-    isNarrowAspectRatio,
15 14
     makeAspectRatioAware
16 15
 } from '../../base/responsive-ui';
17 16
 import { TestConnectionInfo } from '../../base/testing';
18 17
 import { createDesiredLocalTracks } from '../../base/tracks';
19 18
 import { ConferenceNotification } from '../../calendar-sync';
20 19
 import {
21
-    FILMSTRIP_SIZE,
22 20
     Filmstrip,
23 21
     isFilmstripVisible,
24 22
     TileView
25 23
 } from '../../filmstrip';
26 24
 import { LargeVideo } from '../../large-video';
27 25
 import { CalleeInfoContainer } from '../../invite';
28
-import { NotificationsContainer } from '../../notifications';
29 26
 import { Captions } from '../../subtitles';
30 27
 import { setToolboxVisible, Toolbox } from '../../toolbox';
31 28
 import { shouldDisplayTileView } from '../../video-layout';
@@ -305,12 +302,6 @@ class Conference extends Component<Props> {
305 302
                 <View
306 303
                     pointerEvents = 'box-none'
307 304
                     style = { styles.toolboxAndFilmstripContainer }>
308
-                    {/*
309
-                      * Notifications are rendered on the very top of other
310
-                      * components like subtitles, toolbox and filmstrip.
311
-                      */
312
-                        this._renderNotificationsContainer()
313
-                    }
314 305
 
315 306
                     <Captions onPress = { this._onClick } />
316 307
 
@@ -336,6 +327,7 @@ class Conference extends Component<Props> {
336 327
                 {
337 328
                     this._renderConferenceNotification()
338 329
                 }
330
+
339 331
             </Container>
340 332
         );
341 333
     }
@@ -386,33 +378,6 @@ class Conference extends Component<Props> {
386 378
                 ? <ConferenceNotification />
387 379
                 : undefined);
388 380
     }
389
-
390
-    /**
391
-     * Renders a container for notifications to be displayed by the
392
-     * base/notifications feature.
393
-     *
394
-     * @private
395
-     * @returns {React$Element}
396
-     */
397
-    _renderNotificationsContainer() {
398
-        const notificationsStyle = {};
399
-
400
-        // In the landscape mode (wide) there's problem with notifications being
401
-        // shadowed by the filmstrip rendered on the right. This makes the "x"
402
-        // button not clickable. In order to avoid that a margin of the
403
-        // filmstrip's size is added to the right.
404
-        //
405
-        // Pawel: after many attempts I failed to make notifications adjust to
406
-        // their contents width because of column and rows being used in the
407
-        // flex layout. The only option that seemed to limit the notification's
408
-        // size was explicit 'width' value which is not better than the margin
409
-        // added here.
410
-        if (this.props._filmstripVisible && !isNarrowAspectRatio(this)) {
411
-            notificationsStyle.marginRight = FILMSTRIP_SIZE;
412
-        }
413
-
414
-        return <NotificationsContainer style = { notificationsStyle } />;
415
-    }
416 381
 }
417 382
 
418 383
 /**

+ 0
- 106
react/features/notifications/components/Notification.native.js Parādīt failu

@@ -1,106 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import { Text, TouchableOpacity, View } from 'react-native';
5
-
6
-import { Icon } from '../../base/font-icons';
7
-import { translate } from '../../base/i18n';
8
-
9
-import { NOTIFICATION_TYPE } from '../constants';
10
-
11
-import AbstractNotification, {
12
-    type Props
13
-} from './AbstractNotification';
14
-import styles from './styles';
15
-
16
-/**
17
- * Implements a React {@link Component} to display a notification.
18
- *
19
- * @extends Component
20
- */
21
-class Notification extends AbstractNotification<Props> {
22
-    /**
23
-     * Implements React's {@link Component#render()}.
24
-     *
25
-     * @inheritdoc
26
-     * @returns {ReactElement}
27
-     */
28
-    render() {
29
-        const {
30
-            appearance,
31
-            isDismissAllowed,
32
-            t,
33
-            title,
34
-            titleArguments,
35
-            titleKey
36
-        } = this.props;
37
-
38
-        let notificationStyle;
39
-
40
-        switch (appearance) {
41
-        case NOTIFICATION_TYPE.ERROR:
42
-            notificationStyle = styles.notificationTypeError;
43
-            break;
44
-        case NOTIFICATION_TYPE.NORMAL:
45
-            notificationStyle = styles.notificationTypeNormal;
46
-            break;
47
-        case NOTIFICATION_TYPE.SUCCESS:
48
-            notificationStyle = styles.notificationTypeSuccess;
49
-            break;
50
-        case NOTIFICATION_TYPE.WARNING:
51
-            notificationStyle = styles.notificationTypeWarning;
52
-            break;
53
-        case NOTIFICATION_TYPE.INFO:
54
-        default:
55
-            notificationStyle = styles.notificationTypeInfo;
56
-        }
57
-
58
-        return (
59
-            <View
60
-                pointerEvents = 'box-none'
61
-                style = { [
62
-                    styles.notification,
63
-                    notificationStyle
64
-                ] }>
65
-                <View style = { styles.contentColumn }>
66
-                    <View
67
-                        pointerEvents = 'box-none'
68
-                        style = { styles.notificationTitle }>
69
-                        <Text style = { styles.titleText }>
70
-                            {
71
-                                title || t(titleKey, titleArguments)
72
-                            }
73
-                        </Text>
74
-                    </View>
75
-                    <View
76
-                        pointerEvents = 'box-none'
77
-                        style = { styles.notificationContent }>
78
-                        {
79
-                            this._getDescription().map((line, index) => (
80
-                                <Text
81
-                                    key = { index }
82
-                                    style = { styles.contentText }>
83
-                                    { line }
84
-                                </Text>
85
-                            ))
86
-                        }
87
-                    </View>
88
-                </View>
89
-                {
90
-                    isDismissAllowed
91
-                    && <TouchableOpacity onPress = { this._onDismissed }>
92
-                        <Icon
93
-                            name = { 'close' }
94
-                            style = { styles.dismissIcon } />
95
-                    </TouchableOpacity>
96
-                }
97
-            </View>
98
-        );
99
-    }
100
-
101
-    _getDescription: () => Array<string>;
102
-
103
-    _onDismissed: () => void;
104
-}
105
-
106
-export default translate(Notification);

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

@@ -1,68 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import { View } from 'react-native';
5
-import { connect } from 'react-redux';
6
-
7
-import AbstractNotificationsContainer, {
8
-    _abstractMapStateToProps,
9
-    type Props as AbstractProps
10
-} from './AbstractNotificationsContainer';
11
-import Notification from './Notification';
12
-import styles from './styles';
13
-
14
-type Props = AbstractProps & {
15
-
16
-    /**
17
-     * Any custom styling applied to the notifications container.
18
-     */
19
-    style: Object
20
-};
21
-
22
-/**
23
- * Implements a React {@link Component} which displays notifications and handles
24
- * automatic dismissmal after a notification is shown for a defined timeout
25
- * period.
26
- *
27
- * @extends {Component}
28
- */
29
-class NotificationsContainer
30
-    extends AbstractNotificationsContainer<Props> {
31
-
32
-    /**
33
-     * Implements React's {@link Component#render()}.
34
-     *
35
-     * @inheritdoc
36
-     * @returns {ReactElement}
37
-     */
38
-    render() {
39
-        const { _notifications } = this.props;
40
-
41
-        if (!_notifications || !_notifications.length) {
42
-            return null;
43
-        }
44
-
45
-        return (
46
-            <View
47
-                pointerEvents = 'box-none'
48
-                style = { [
49
-                    styles.notificationContainer,
50
-                    this.props.style
51
-                ] } >
52
-                {
53
-                    _notifications.map(
54
-                        ({ props, uid }) => (
55
-                            <Notification
56
-                                { ...props }
57
-                                key = { uid }
58
-                                onDismissed = { this._onDismissed }
59
-                                uid = { uid } />))
60
-                }
61
-            </View>
62
-        );
63
-    }
64
-
65
-    _onDismissed: number => void;
66
-}
67
-
68
-export default connect(_abstractMapStateToProps)(NotificationsContainer);

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

@@ -1,104 +0,0 @@
1
-// @flow
2
-
3
-import { BoxModel, createStyleSheet, ColorPalette } from '../../base/styles';
4
-
5
-/**
6
- * The styles of the React {@code Components} of the feature notifications.
7
- */
8
-export default createStyleSheet({
9
-
10
-    /**
11
-     * The content (left) column of the notification.
12
-     */
13
-    contentColumn: {
14
-        flex: 1,
15
-        flexDirection: 'column',
16
-        padding: BoxModel.padding
17
-    },
18
-
19
-    /**
20
-     * Test style of the notification.
21
-     */
22
-    contentText: {
23
-        color: ColorPalette.white
24
-    },
25
-
26
-    /**
27
-     * Dismiss icon style.
28
-     */
29
-    dismissIcon: {
30
-        alignSelf: 'center',
31
-        color: ColorPalette.white,
32
-        fontSize: 16,
33
-        padding: 1.5 * BoxModel.padding
34
-    },
35
-
36
-    /**
37
-     * Outermost view of a single notification.
38
-     */
39
-    notification: {
40
-        borderRadius: 5,
41
-        flexDirection: 'row',
42
-        marginTop: 0.5 * BoxModel.margin
43
-    },
44
-
45
-    /**
46
-     * Outermost container of a list of notifications.
47
-     */
48
-    notificationContainer: {
49
-        flexGrow: 0,
50
-        justifyContent: 'flex-end',
51
-        padding: 2 * BoxModel.padding,
52
-        paddingBottom: BoxModel.padding
53
-    },
54
-
55
-    /**
56
-     * Wrapper for the message (without title).
57
-     */
58
-    notificationContent: {
59
-        flexDirection: 'column',
60
-        paddingVertical: 0.5 * BoxModel.padding
61
-    },
62
-
63
-    /**
64
-     * The View containing the title.
65
-     */
66
-    notificationTitle: {
67
-        paddingVertical: 0.5 * BoxModel.padding
68
-    },
69
-
70
-    /**
71
-     * Background settings for different notification types.
72
-     */
73
-
74
-    notificationTypeError: {
75
-        backgroundColor: ColorPalette.R400
76
-    },
77
-
78
-    notificationTypeInfo: {
79
-        backgroundColor: ColorPalette.N500
80
-    },
81
-
82
-    notificationTypeNormal: {
83
-        // NOTE: Mobile has black background when the large video doesn't render
84
-        // a stream, so we avoid using black as the background of the normal
85
-        // type notifications.
86
-        backgroundColor: ColorPalette.N500
87
-    },
88
-
89
-    notificationTypeSuccess: {
90
-        backgroundColor: ColorPalette.G400
91
-    },
92
-
93
-    notificationTypeWarning: {
94
-        backgroundColor: ColorPalette.Y200
95
-    },
96
-
97
-    /**
98
-     * Title text style.
99
-     */
100
-    titleText: {
101
-        color: ColorPalette.white,
102
-        fontWeight: 'bold'
103
-    }
104
-});

Notiek ielāde…
Atcelt
Saglabāt