Browse Source

rn: lonely meeting experience

master
Zoltan Bettenbuk 5 years ago
parent
commit
8d3b59a0d0
No account linked to committer's email address

+ 4
- 0
lang/main.json View File

769
         "sendFeedback": "Send feedback",
769
         "sendFeedback": "Send feedback",
770
         "terms": "Terms",
770
         "terms": "Terms",
771
         "title": "Secure, fully featured, and completely free video conferencing"
771
         "title": "Secure, fully featured, and completely free video conferencing"
772
+    },
773
+    "lonelyMeetingExperience": {
774
+        "button": "Invite others",
775
+        "youAreAlone": "You are the only one in the meeting"
772
     }
776
     }
773
 }
777
 }

+ 4
- 0
react/features/base/color-scheme/defaultScheme.js View File

23
         replyBorder: 'rgb(219, 197, 200)',
23
         replyBorder: 'rgb(219, 197, 200)',
24
         replyIcon: 'rgb(94, 109, 121)'
24
         replyIcon: 'rgb(94, 109, 121)'
25
     },
25
     },
26
+    'Conference': {
27
+        inviteButtonBackground: 'rgb(0, 119, 225)',
28
+        onVideoText: 'white'
29
+    },
26
     'Dialog': {
30
     'Dialog': {
27
         border: 'rgba(0, 3, 6, 0.6)',
31
         border: 'rgba(0, 3, 6, 0.6)',
28
         buttonBackground: ColorPalette.blue,
32
         buttonBackground: ColorPalette.blue,

+ 3
- 0
react/features/conference/components/native/Conference.js View File

34
     abstractMapStateToProps
34
     abstractMapStateToProps
35
 } from '../AbstractConference';
35
 } from '../AbstractConference';
36
 import Labels from './Labels';
36
 import Labels from './Labels';
37
+import LonelyMeetingExperience from './LonelyMeetingExperience';
37
 import NavigationBar from './NavigationBar';
38
 import NavigationBar from './NavigationBar';
38
 import styles, { NAVBAR_GRADIENT_COLORS } from './styles';
39
 import styles, { NAVBAR_GRADIENT_COLORS } from './styles';
39
 
40
 
305
 
306
 
306
                     { _shouldDisplayTileView || <DisplayNameLabel participantId = { _largeVideoParticipantId } /> }
307
                     { _shouldDisplayTileView || <DisplayNameLabel participantId = { _largeVideoParticipantId } /> }
307
 
308
 
309
+                    <LonelyMeetingExperience />
310
+
308
                     {/*
311
                     {/*
309
                       * The Toolbox is in a stacking layer below the Filmstrip.
312
                       * The Toolbox is in a stacking layer below the Filmstrip.
310
                       */}
313
                       */}

+ 143
- 0
react/features/conference/components/native/LonelyMeetingExperience.js View File

1
+// @flow
2
+
3
+import React, { PureComponent } from 'react';
4
+import { Text, TouchableOpacity, View } from 'react-native';
5
+
6
+import { ColorSchemeRegistry } from '../../../base/color-scheme';
7
+import { getFeatureFlag, INVITE_ENABLED } from '../../../base/flags';
8
+import { connect } from '../../../base/redux';
9
+import { StyleType } from '../../../base/styles';
10
+import { translate } from '../../../base/i18n';
11
+import { getParticipantCount } from '../../../base/participants';
12
+import { isAddPeopleEnabled, isDialOutEnabled, setAddPeopleDialogVisible } from '../../../invite';
13
+import { beginShareRoom } from '../../../share-room';
14
+
15
+import styles from './styles';
16
+import { Icon, IconAddPeople } from '../../../base/icons';
17
+
18
+/**
19
+ * Props type of the component.
20
+ */
21
+type Props = {
22
+
23
+    /**
24
+     * True if any of the invite functions are enabled.
25
+     */
26
+    _inviteEnabled: boolean,
27
+
28
+    /**
29
+     * True if it's a lonely meeting (participant count excluding fakes is 1).
30
+     */
31
+    _isLonelyMeeting: boolean,
32
+
33
+    /**
34
+     * Color schemed styles of the component.
35
+     */
36
+    _styles: StyleType,
37
+
38
+    /**
39
+     * The Redux Dispatch function.
40
+     */
41
+    dispatch: Function,
42
+
43
+    /**
44
+     * Function to be used to translate i18n labels.
45
+     */
46
+    t: Function
47
+};
48
+
49
+/**
50
+ * Implements the UI elements to be displayed in the lonely meeting experience.
51
+ */
52
+class LonelyMeetingExperience extends PureComponent<Props> {
53
+    /**
54
+     * Instantiates a new component.
55
+     *
56
+     * @inheritdoc
57
+     */
58
+    constructor(props: Props) {
59
+        super(props);
60
+
61
+        this._onPress = this._onPress.bind(this);
62
+    }
63
+
64
+    /**
65
+     * Implements {@code PureComponent#render}.
66
+     *
67
+     * @inheritdoc
68
+     */
69
+    render() {
70
+        const { _isLonelyMeeting, _styles, t } = this.props;
71
+
72
+        if (!_isLonelyMeeting) {
73
+            return null;
74
+        }
75
+
76
+        return (
77
+            <View style = { styles.lonelyMeetingContainer }>
78
+                <Text
79
+                    style = { [
80
+                        styles.lonelyMessage,
81
+                        _styles.lonelyMessage
82
+                    ] }>
83
+                    { t('lonelyMeetingExperience.youAreAlone') }
84
+                </Text>
85
+                <TouchableOpacity
86
+                    onPress = { this._onPress }
87
+                    style = { [
88
+                        styles.lonelyButton,
89
+                        _styles.lonelyButton
90
+                    ] }>
91
+                    <Icon
92
+                        size = { 24 }
93
+                        src = { IconAddPeople }
94
+                        style = { styles.lonelyButtonComponents } />
95
+                    <Text
96
+                        style = { [
97
+                            styles.lonelyButtonComponents,
98
+                            _styles.lonelyMessage
99
+                        ] }>
100
+                        { t('lonelyMeetingExperience.button') }
101
+                    </Text>
102
+                </TouchableOpacity>
103
+            </View>
104
+        );
105
+    }
106
+
107
+    _onPress: () => void;
108
+
109
+    /**
110
+     * Callback for the onPress function of the button.
111
+     *
112
+     * @returns {void}
113
+     */
114
+    _onPress() {
115
+        const { _inviteEnabled, dispatch } = this.props;
116
+
117
+        if (_inviteEnabled) {
118
+            dispatch(setAddPeopleDialogVisible(true));
119
+        } else {
120
+            dispatch(beginShareRoom());
121
+        }
122
+    }
123
+}
124
+
125
+/**
126
+ * Maps parts of the Redux state to the props of this Component.
127
+ *
128
+ * @param {Object} state - The redux state.
129
+ * @private
130
+ * @returns {Props}
131
+ */
132
+function _mapStateToProps(state): $Shape<Props> {
133
+    const _inviteEnabled = getFeatureFlag(state, INVITE_ENABLED, true)
134
+        && (isAddPeopleEnabled(state) || isDialOutEnabled(state));
135
+
136
+    return {
137
+        _inviteEnabled,
138
+        _isLonelyMeeting: getParticipantCount(state) === 1,
139
+        _styles: ColorSchemeRegistry.get(state, 'Conference')
140
+    };
141
+}
142
+
143
+export default connect(_mapStateToProps)(translate(LonelyMeetingExperience));

+ 34
- 1
react/features/conference/components/native/styles.js View File

1
 import { BoxModel, ColorPalette, fixAndroidViewClipping } from '../../../base/styles';
1
 import { BoxModel, ColorPalette, fixAndroidViewClipping } from '../../../base/styles';
2
-
2
+import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
3
 import { FILMSTRIP_SIZE } from '../../../filmstrip';
3
 import { FILMSTRIP_SIZE } from '../../../filmstrip';
4
 
4
 
5
 export const NAVBAR_GRADIENT_COLORS = [ '#000000FF', '#00000000' ];
5
 export const NAVBAR_GRADIENT_COLORS = [ '#000000FF', '#00000000' ];
72
         top: 0
72
         top: 0
73
     },
73
     },
74
 
74
 
75
+    lonelyButton: {
76
+        alignItems: 'center',
77
+        borderRadius: 24,
78
+        flexDirection: 'row',
79
+        height: 48,
80
+        justifyContent: 'space-around',
81
+        paddingHorizontal: 12
82
+    },
83
+
84
+    lonelyButtonComponents: {
85
+        marginHorizontal: 6
86
+    },
87
+
88
+    lonelyMeetingContainer: {
89
+        alignSelf: 'stretch',
90
+        alignItems: 'center',
91
+        padding: BoxModel.padding * 2
92
+    },
93
+
94
+    lonelyMessage: {
95
+        paddingVertical: 12
96
+    },
97
+
75
     navBarButton: {
98
     navBarButton: {
76
         iconStyle: {
99
         iconStyle: {
77
             color: ColorPalette.white,
100
             color: ColorPalette.white,
146
         top: BoxModel.margin * 3
169
         top: BoxModel.margin * 3
147
     }
170
     }
148
 };
171
 };
172
+
173
+ColorSchemeRegistry.register('Conference', {
174
+    lonelyButton: {
175
+        backgroundColor: schemeColor('inviteButtonBackground')
176
+    },
177
+
178
+    lonelyMessage: {
179
+        color: schemeColor('onVideoText')
180
+    }
181
+});

Loading…
Cancel
Save