From 99b5a4126993fffc1e7d8b062c71be6545d734b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 22 May 2018 11:32:09 +0200 Subject: [PATCH 1/2] feat(toolbox): add ability to run a handler after click to AbstractButton --- react/features/base/toolbox/components/AbstractButton.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/react/features/base/toolbox/components/AbstractButton.js b/react/features/base/toolbox/components/AbstractButton.js index 908f05c59..f07f2eca6 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 extends Component { static defaultProps = { + afterClick: undefined, showLabel: false, styles: undefined, toggledStyles: undefined, @@ -165,7 +171,10 @@ export default class AbstractButton extends Component { * @returns {void} */ _onClick() { + const { afterClick } = this.props; + this._handleClick(); + afterClick && afterClick(); } /** From a8b1ca38dc61ff7a524ec8ed95baed8dad9eb4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 22 May 2018 11:33:03 +0200 Subject: [PATCH 2/2] [RN] Dismiss OverflowMenu after selecting an option --- .../toolbox/components/native/OverflowMenu.js | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/react/features/toolbox/components/native/OverflowMenu.js b/react/features/toolbox/components/native/OverflowMenu.js index f29354c56..01fd32b47 100644 --- a/react/features/toolbox/components/native/OverflowMenu.js +++ b/react/features/toolbox/components/native/OverflowMenu.js @@ -56,23 +56,19 @@ class OverflowMenu extends Component { * @returns {ReactElement} */ render() { + const buttonProps = { + afterClick: this._onCancel, + showLabel: true, + styles: overflowMenuItemStyles + }; + return ( - - - - - + + + + + ); }