瀏覽代碼

feat(toolbar): add beta tag to live streaming button (#3007)

* feat(toolbar): add beta tag to live streaming button

* tweak colors and border radius
master
virtuacoplenny 7 年之前
父節點
當前提交
f608ad4e5e
沒有連結到貢獻者的電子郵件帳戶。

+ 11
- 0
css/_toolbars.scss 查看文件

133
             }
133
             }
134
         }
134
         }
135
 
135
 
136
+        .beta-tag {
137
+            background: #B8C7E0;
138
+            border-radius: 2px;
139
+            color: $newToolbarBackgroundColor;
140
+            font-family: -apple-system, BlinkMacSystemFont, $baseFontFamily;
141
+            font-size: 11px;
142
+            font-weight: bold;
143
+            margin-left: 8px;
144
+            padding: 0 6px;
145
+        }
146
+
136
         .overflow-menu-item-icon {
147
         .overflow-menu-item-icon {
137
             margin-right: 10px;
148
             margin-right: 10px;
138
 
149
 

+ 3
- 2
lang/main.json 查看文件

290
         "sorryFeedback": "We're sorry to hear that. Would you like to tell us more?",
290
         "sorryFeedback": "We're sorry to hear that. Would you like to tell us more?",
291
         "liveStreaming": "Live Streaming",
291
         "liveStreaming": "Live Streaming",
292
         "streamKey": "Live stream key",
292
         "streamKey": "Live stream key",
293
-        "startLiveStreaming": "Go live now",
293
+        "startLiveStreaming": "Start live stream",
294
         "startRecording": "Start recording",
294
         "startRecording": "Start recording",
295
         "stopStreamingWarning": "Are you sure you would like to stop the live streaming?",
295
         "stopStreamingWarning": "Are you sure you would like to stop the live streaming?",
296
         "stopRecordingWarning": "Are you sure you would like to stop the recording?",
296
         "stopRecordingWarning": "Are you sure you would like to stop the recording?",
297
-        "stopLiveStreaming": "Stop live streaming",
297
+        "stopLiveStreaming": "Stop live stream",
298
         "stopRecording": "Stop recording",
298
         "stopRecording": "Stop recording",
299
         "doNotShowMessageAgain": "Don't show this message again",
299
         "doNotShowMessageAgain": "Don't show this message again",
300
         "permissionDenied": "Permission Denied",
300
         "permissionDenied": "Permission Denied",
386
     },
386
     },
387
     "recording":
387
     "recording":
388
     {
388
     {
389
+        "beta": "BETA",
389
         "busy": "We're working on freeing recording resources. Please try again in a few minutes.",
390
         "busy": "We're working on freeing recording resources. Please try again in a few minutes.",
390
         "busyTitle": "All recorders are currently busy",
391
         "busyTitle": "All recorders are currently busy",
391
         "buttonTooltip": "Start / Stop recording",
392
         "buttonTooltip": "Start / Stop recording",

+ 69
- 0
react/features/toolbox/components/web/OverflowMenuLiveStreamingItem.js 查看文件

1
+// @flow
2
+
3
+import React, { Component } from 'react';
4
+
5
+import { translate } from '../../../base/i18n';
6
+
7
+/**
8
+ * The type of the React {@code Component} props of
9
+ * {@link OverflowMenuLiveStreamingItem}.
10
+ */
11
+type Props = {
12
+
13
+    /**
14
+     * The callback to invoke when {@code OverflowMenuLiveStreamingItem} is
15
+     * clicked.
16
+     */
17
+    onClick: Function,
18
+
19
+    /**
20
+     * The current live streaming session, if any.
21
+     */
22
+    session: ?Object,
23
+
24
+    /**
25
+     * Invoked to obtain translated strings.
26
+     */
27
+    t: Function
28
+};
29
+
30
+/**
31
+ * React {@code Component} for starting or stopping a live streaming of the
32
+ * current conference and displaying the current state of live streaming.
33
+ *
34
+ * @extends Component
35
+ */
36
+class OverflowMenuLiveStreamingItem extends Component<Props> {
37
+    /**
38
+     * Implements React's {@link Component#render()}.
39
+     *
40
+     * @inheritdoc
41
+     * @returns {ReactElement}
42
+     */
43
+    render() {
44
+        const { onClick, session, t } = this.props;
45
+
46
+        const translationKey = session
47
+            ? 'dialog.stopLiveStreaming'
48
+            : 'dialog.startLiveStreaming';
49
+
50
+        return (
51
+            <li
52
+                aria-label = 'Live stream'
53
+                className = 'overflow-menu-item'
54
+                onClick = { onClick }>
55
+                <span className = 'overflow-menu-item-icon'>
56
+                    <i className = 'icon-public' />
57
+                </span>
58
+                <span className = 'profile-text'>
59
+                    { t(translationKey) }
60
+                </span>
61
+                <span className = 'beta-tag'>
62
+                    { t('recording.beta') }
63
+                </span>
64
+            </li>
65
+        );
66
+    }
67
+}
68
+
69
+export default translate(OverflowMenuLiveStreamingItem);

+ 6
- 25
react/features/toolbox/components/web/Toolbox.js 查看文件

53
 import HangupButton from '../HangupButton';
53
 import HangupButton from '../HangupButton';
54
 import OverflowMenuButton from './OverflowMenuButton';
54
 import OverflowMenuButton from './OverflowMenuButton';
55
 import OverflowMenuItem from './OverflowMenuItem';
55
 import OverflowMenuItem from './OverflowMenuItem';
56
+import OverflowMenuLiveStreamingItem from './OverflowMenuLiveStreamingItem';
56
 import OverflowMenuProfileItem from './OverflowMenuProfileItem';
57
 import OverflowMenuProfileItem from './OverflowMenuProfileItem';
57
 import ToolbarButton from './ToolbarButton';
58
 import ToolbarButton from './ToolbarButton';
58
 import VideoMuteButton from '../VideoMuteButton';
59
 import VideoMuteButton from '../VideoMuteButton';
941
         );
942
         );
942
     }
943
     }
943
 
944
 
944
-    /**
945
-     * Renders an {@code OverflowMenuItem} for starting or stopping a live
946
-     * streaming of the current conference.
947
-     *
948
-     * @private
949
-     * @returns {ReactElement}
950
-     */
951
-    _renderLiveStreamingButton() {
952
-        const { _liveStreamingSession, t } = this.props;
953
-
954
-        const translationKey = _liveStreamingSession
955
-            ? 'dialog.stopLiveStreaming'
956
-            : 'dialog.startLiveStreaming';
957
-
958
-        return (
959
-            <OverflowMenuItem
960
-                accessibilityLabel = 'Live stream'
961
-                icon = 'icon-public'
962
-                key = 'liveStreaming'
963
-                onClick = { this._onToolbarToggleLiveStreaming }
964
-                text = { t(translationKey) } />
965
-        );
966
-    }
967
-
968
     /**
945
     /**
969
      * Renders the list elements of the overflow menu.
946
      * Renders the list elements of the overflow menu.
970
      *
947
      *
978
             _feedbackConfigured,
955
             _feedbackConfigured,
979
             _fullScreen,
956
             _fullScreen,
980
             _isGuest,
957
             _isGuest,
958
+            _liveStreamingSession,
981
             _recordingEnabled,
959
             _recordingEnabled,
982
             _sharingVideo,
960
             _sharingVideo,
983
             t
961
             t
1006
                         : t('toolbar.enterFullScreen') } />,
984
                         : t('toolbar.enterFullScreen') } />,
1007
             _recordingEnabled
985
             _recordingEnabled
1008
                 && this._shouldShowButton('livestreaming')
986
                 && this._shouldShowButton('livestreaming')
1009
-                && this._renderLiveStreamingButton(),
987
+                && <OverflowMenuLiveStreamingItem
988
+                    key = 'livestreaming'
989
+                    onClick = { this._onToolbarToggleLiveStreaming }
990
+                    session = { _liveStreamingSession } />,
1010
             _recordingEnabled
991
             _recordingEnabled
1011
                 && this._shouldShowButton('recording')
992
                 && this._shouldShowButton('recording')
1012
                 && this._renderRecordingButton(),
993
                 && this._renderRecordingButton(),

Loading…
取消
儲存