Browse Source

feat(toolbox): rename label / tooltip getters in ToolboxItem

master
Saúl Ibarra Corretgé 7 years ago
parent
commit
bce2438471

+ 4
- 4
react/features/base/toolbox/components/AbstractToolboxItem.js View File

122
      * provided then it will be translated using it.
122
      * provided then it will be translated using it.
123
      *
123
      *
124
      * @protected
124
      * @protected
125
-     * @returns {string}
125
+     * @returns {?string}
126
      */
126
      */
127
-    get _label() {
127
+    get label(): ?string {
128
         return this._maybeTranslateAttribute(this.props.label);
128
         return this._maybeTranslateAttribute(this.props.label);
129
     }
129
     }
130
 
130
 
133
      * provided then it will be translated using it.
133
      * provided then it will be translated using it.
134
      *
134
      *
135
      * @protected
135
      * @protected
136
-     * @returns {string}
136
+     * @returns {?string}
137
      */
137
      */
138
-    get _tooltip() {
138
+    get tooltip(): ?string {
139
         return this._maybeTranslateAttribute(this.props.tooltip);
139
         return this._maybeTranslateAttribute(this.props.tooltip);
140
     }
140
     }
141
 
141
 

+ 2
- 5
react/features/base/toolbox/components/ToolboxItem.web.js View File

10
  * Web implementation of {@code AbstractToolboxItem}.
10
  * Web implementation of {@code AbstractToolboxItem}.
11
  */
11
  */
12
 export default class ToolboxItem extends AbstractToolboxItem<Props> {
12
 export default class ToolboxItem extends AbstractToolboxItem<Props> {
13
-    _label: string;
14
-    _tooltip: string;
15
-
16
     /**
13
     /**
17
      * Handles rendering of the actual item. If the label is being shown, which
14
      * Handles rendering of the actual item. If the label is being shown, which
18
      * is controlled with the `showLabel` prop, the item is rendered for its
15
      * is controlled with the `showLabel` prop, the item is rendered for its
40
             // $FlowFixMe
37
             // $FlowFixMe
41
             <React.Fragment>
38
             <React.Fragment>
42
                 { this._renderIcon() }
39
                 { this._renderIcon() }
43
-                { showLabel && this._label }
40
+                { showLabel && this.label }
44
             </React.Fragment>
41
             </React.Fragment>
45
         );
42
         );
46
 
43
 
61
             = showLabel ? 'overflow-menu-item-icon' : 'toolbox-icon';
58
             = showLabel ? 'overflow-menu-item-icon' : 'toolbox-icon';
62
         const iconWrapper
59
         const iconWrapper
63
             = React.createElement(elementType, { className }, icon);
60
             = React.createElement(elementType, { className }, icon);
64
-        const tooltip = this._tooltip;
61
+        const tooltip = this.tooltip;
65
         const useTooltip = !showLabel && tooltip && tooltip.length > 0;
62
         const useTooltip = !showLabel && tooltip && tooltip.length > 0;
66
 
63
 
67
         if (useTooltip) {
64
         if (useTooltip) {

Loading…
Cancel
Save