ref(toolbox): getter for the recording/streaming disabled tooltip
This commit is contained in:
parent
85f487cca5
commit
007d60eb6c
|
@ -206,6 +206,16 @@ export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
|
|||
return buttonStyles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tooltip to display when hovering over the button.
|
||||
*
|
||||
* @private
|
||||
* @returns {string}
|
||||
*/
|
||||
_getTooltip() {
|
||||
return this.tooltip || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to be implemented by subclasses, which must return a
|
||||
* boolean value indicating if this button is disabled or not.
|
||||
|
@ -258,7 +268,7 @@ export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
|
|||
iconName: this._getIconName(),
|
||||
label: this._getLabel(),
|
||||
styles: this._getStyles(),
|
||||
tooltip: this.tooltip
|
||||
tooltip: this._getTooltip()
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -37,26 +37,6 @@ class LiveStreamButton extends AbstractLiveStreamButton<Props> {
|
|||
iconName = 'icon-public';
|
||||
toggledIconName = 'icon-public';
|
||||
|
||||
/**
|
||||
* Constructor of the component.
|
||||
*
|
||||
* @inheritdoc
|
||||
*/
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.tooltip = props._liveStreamDisabledTooltipKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements {@code Component}'s componentWillReceiveProps.
|
||||
*
|
||||
* @inheritdoc
|
||||
*/
|
||||
componentWillReceiveProps(newProps: Props) {
|
||||
this.tooltip = newProps._liveStreamDisabledTooltipKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to be implemented by subclasses, which returns
|
||||
* a React Element to display (a beta tag) at the end of the button.
|
||||
|
@ -76,6 +56,16 @@ class LiveStreamButton extends AbstractLiveStreamButton<Props> {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tooltip that should be displayed when the button is disabled.
|
||||
*
|
||||
* @private
|
||||
* @returns {string}
|
||||
*/
|
||||
_getTooltip() {
|
||||
return this.props._liveStreamDisabledTooltipKey || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to be implemented by subclasses, which must return a
|
||||
* boolean value indicating if this button is disabled or not.
|
||||
|
|
|
@ -36,23 +36,13 @@ class RecordButton extends AbstractRecordButton<Props> {
|
|||
toggledIconName = 'icon-camera-take-picture';
|
||||
|
||||
/**
|
||||
* Constructor of the component.
|
||||
* Returns the tooltip that should be displayed when the button is disabled.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @private
|
||||
* @returns {string}
|
||||
*/
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.tooltip = props._fileRecordingsDisabledTooltipKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements {@code Component}'s componentWillReceiveProps.
|
||||
*
|
||||
* @inheritdoc
|
||||
*/
|
||||
componentWillReceiveProps(newProps: Props) {
|
||||
this.tooltip = newProps._fileRecordingsDisabledTooltipKey;
|
||||
_getTooltip() {
|
||||
return this.tooltip || '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue