Skip to content

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

feat(toolbox): add ability to run a handler after click to AbstractButton

Saúl Ibarra Corretgé99b5a4126993
diff --git a/react/features/base/toolbox/components/AbstractButton.js b/react/features/base/toolbox/components/AbstractButton.js
index 908f05c592..f07f2eca63 100644
--- a/react/features/base/toolbox/components/AbstractButton.js
+++ b/react/features/base/toolbox/components/AbstractButton.js
@@ -7,6 +7,11 @@ import ToolboxItem from './ToolboxItem';
export type Props = {
+ /**
+ * Function to be called after the click handler has been processed.
+ */
+ afterClick: ?Function,
+
/**
* Whether to show the label or not.
*/
@@ -38,6 +43,7 @@ export type Props = {
*/
export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
static defaultProps = {
+ afterClick: undefined,
showLabel: false,
styles: undefined,
toggledStyles: undefined,
@@ -165,7 +171,10 @@ export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
* @returns {void}
*/
_onClick() {
+ const { afterClick } = this.props;
+
this._handleClick();
+ afterClick && afterClick();
}
/**