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,9 +122,9 @@ export default class AbstractToolboxItem<P : Props> extends Component<P> {
122 122
      * provided then it will be translated using it.
123 123
      *
124 124
      * @protected
125
-     * @returns {string}
125
+     * @returns {?string}
126 126
      */
127
-    get _label() {
127
+    get label(): ?string {
128 128
         return this._maybeTranslateAttribute(this.props.label);
129 129
     }
130 130
 
@@ -133,9 +133,9 @@ export default class AbstractToolboxItem<P : Props> extends Component<P> {
133 133
      * provided then it will be translated using it.
134 134
      *
135 135
      * @protected
136
-     * @returns {string}
136
+     * @returns {?string}
137 137
      */
138
-    get _tooltip() {
138
+    get tooltip(): ?string {
139 139
         return this._maybeTranslateAttribute(this.props.tooltip);
140 140
     }
141 141
 

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

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

Loading…
Cancel
Save