Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Leonard Kim007d60eb6cc8
diff --git a/react/features/base/toolbox/components/AbstractButton.js b/react/features/base/toolbox/components/AbstractButton.js
index de6f1c0e93..f3364ca5d1 100644
--- a/react/features/base/toolbox/components/AbstractButton.js
+++ b/react/features/base/toolbox/components/AbstractButton.js
@@ -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 (
diff --git a/react/features/recording/components/LiveStream/web/LiveStreamButton.js b/react/features/recording/components/LiveStream/web/LiveStreamButton.js
index 3921440db3..9345160c06 100644
--- a/react/features/recording/components/LiveStream/web/LiveStreamButton.js
+++ b/react/features/recording/components/LiveStream/web/LiveStreamButton.js
@@ -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.
diff --git a/react/features/recording/components/Recording/web/RecordButton.js b/react/features/recording/components/Recording/web/RecordButton.js
index 8abc848f1e..d3f919bdfd 100644
--- a/react/features/recording/components/Recording/web/RecordButton.js
+++ b/react/features/recording/components/Recording/web/RecordButton.js
@@ -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 || '';
}
/**