Pārlūkot izejas kodu

ref(toolbox): getter for the recording/streaming disabled tooltip

master
Leonard Kim 7 gadus atpakaļ
vecāks
revīzija
007d60eb6c

+ 11
- 1
react/features/base/toolbox/components/AbstractButton.js Parādīt failu

206
         return buttonStyles;
206
         return buttonStyles;
207
     }
207
     }
208
 
208
 
209
+    /**
210
+     * Get the tooltip to display when hovering over the button.
211
+     *
212
+     * @private
213
+     * @returns {string}
214
+     */
215
+    _getTooltip() {
216
+        return this.tooltip || '';
217
+    }
218
+
209
     /**
219
     /**
210
      * Helper function to be implemented by subclasses, which must return a
220
      * Helper function to be implemented by subclasses, which must return a
211
      * boolean value indicating if this button is disabled or not.
221
      * boolean value indicating if this button is disabled or not.
258
             iconName: this._getIconName(),
268
             iconName: this._getIconName(),
259
             label: this._getLabel(),
269
             label: this._getLabel(),
260
             styles: this._getStyles(),
270
             styles: this._getStyles(),
261
-            tooltip: this.tooltip
271
+            tooltip: this._getTooltip()
262
         };
272
         };
263
 
273
 
264
         return (
274
         return (

+ 10
- 20
react/features/recording/components/LiveStream/web/LiveStreamButton.js Parādīt failu

37
     iconName = 'icon-public';
37
     iconName = 'icon-public';
38
     toggledIconName = 'icon-public';
38
     toggledIconName = 'icon-public';
39
 
39
 
40
-    /**
41
-     * Constructor of the component.
42
-     *
43
-     * @inheritdoc
44
-     */
45
-    constructor(props: Props) {
46
-        super(props);
47
-
48
-        this.tooltip = props._liveStreamDisabledTooltipKey;
49
-    }
50
-
51
-    /**
52
-     * Implements {@code Component}'s componentWillReceiveProps.
53
-     *
54
-     * @inheritdoc
55
-     */
56
-    componentWillReceiveProps(newProps: Props) {
57
-        this.tooltip = newProps._liveStreamDisabledTooltipKey;
58
-    }
59
-
60
     /**
40
     /**
61
      * Helper function to be implemented by subclasses, which returns
41
      * Helper function to be implemented by subclasses, which returns
62
      * a React Element to display (a beta tag) at the end of the button.
42
      * a React Element to display (a beta tag) at the end of the button.
76
         );
56
         );
77
     }
57
     }
78
 
58
 
59
+    /**
60
+     * Returns the tooltip that should be displayed when the button is disabled.
61
+     *
62
+     * @private
63
+     * @returns {string}
64
+     */
65
+    _getTooltip() {
66
+        return this.props._liveStreamDisabledTooltipKey || '';
67
+    }
68
+
79
     /**
69
     /**
80
      * Helper function to be implemented by subclasses, which must return a
70
      * Helper function to be implemented by subclasses, which must return a
81
      * boolean value indicating if this button is disabled or not.
71
      * boolean value indicating if this button is disabled or not.

+ 5
- 15
react/features/recording/components/Recording/web/RecordButton.js Parādīt failu

36
     toggledIconName = 'icon-camera-take-picture';
36
     toggledIconName = 'icon-camera-take-picture';
37
 
37
 
38
     /**
38
     /**
39
-     * Constructor of the component.
39
+     * Returns the tooltip that should be displayed when the button is disabled.
40
      *
40
      *
41
-     * @inheritdoc
41
+     * @private
42
+     * @returns {string}
42
      */
43
      */
43
-    constructor(props: Props) {
44
-        super(props);
45
-
46
-        this.tooltip = props._fileRecordingsDisabledTooltipKey;
47
-    }
48
-
49
-    /**
50
-     * Implements {@code Component}'s componentWillReceiveProps.
51
-     *
52
-     * @inheritdoc
53
-     */
54
-    componentWillReceiveProps(newProps: Props) {
55
-        this.tooltip = newProps._fileRecordingsDisabledTooltipKey;
44
+    _getTooltip() {
45
+        return this.tooltip || '';
56
     }
46
     }
57
 
47
 
58
     /**
48
     /**

Notiek ielāde…
Atcelt
Saglabāt