From bce2438471c40bae2be7aa85cff296c0ffb1dae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 15 May 2018 13:22:20 +0200 Subject: [PATCH] feat(toolbox): rename label / tooltip getters in ToolboxItem --- .../base/toolbox/components/AbstractToolboxItem.js | 8 ++++---- react/features/base/toolbox/components/ToolboxItem.web.js | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/react/features/base/toolbox/components/AbstractToolboxItem.js b/react/features/base/toolbox/components/AbstractToolboxItem.js index 08cca5f2c..3e251728a 100644 --- a/react/features/base/toolbox/components/AbstractToolboxItem.js +++ b/react/features/base/toolbox/components/AbstractToolboxItem.js @@ -122,9 +122,9 @@ export default class AbstractToolboxItem

extends Component

{ * provided then it will be translated using it. * * @protected - * @returns {string} + * @returns {?string} */ - get _label() { + get label(): ?string { return this._maybeTranslateAttribute(this.props.label); } @@ -133,9 +133,9 @@ export default class AbstractToolboxItem

extends Component

{ * provided then it will be translated using it. * * @protected - * @returns {string} + * @returns {?string} */ - get _tooltip() { + get tooltip(): ?string { return this._maybeTranslateAttribute(this.props.tooltip); } diff --git a/react/features/base/toolbox/components/ToolboxItem.web.js b/react/features/base/toolbox/components/ToolboxItem.web.js index ac3d6067a..25b7c3ab8 100644 --- a/react/features/base/toolbox/components/ToolboxItem.web.js +++ b/react/features/base/toolbox/components/ToolboxItem.web.js @@ -10,9 +10,6 @@ import type { Props } from './AbstractToolboxItem'; * Web implementation of {@code AbstractToolboxItem}. */ export default class ToolboxItem extends AbstractToolboxItem { - _label: string; - _tooltip: string; - /** * Handles rendering of the actual item. If the label is being shown, which * is controlled with the `showLabel` prop, the item is rendered for its @@ -40,7 +37,7 @@ export default class ToolboxItem extends AbstractToolboxItem { // $FlowFixMe { this._renderIcon() } - { showLabel && this._label } + { showLabel && this.label } ); @@ -61,7 +58,7 @@ export default class ToolboxItem extends AbstractToolboxItem { = showLabel ? 'overflow-menu-item-icon' : 'toolbox-icon'; const iconWrapper = React.createElement(elementType, { className }, icon); - const tooltip = this._tooltip; + const tooltip = this.tooltip; const useTooltip = !showLabel && tooltip && tooltip.length > 0; if (useTooltip) {