From cd7c930172439309fe72a38c2f30bb2c04b4b49b Mon Sep 17 00:00:00 2001 From: Ezekiel Date: Wed, 26 Jun 2024 14:13:41 +0800 Subject: [PATCH] MM-58411 Migrate tooltips of 'components/actions_menu/actions_menu' to WithTooltip (#27238) * Added console log for draft PR * Replaced tooltip component with changes * Updated snapshot for tests * Updated title to use FormattedMessage * Remove defineMessages * Fix style * Removed unused tooltip --------- Co-authored-by: ezekiel Co-authored-by: Mattermost Build --- .../__snapshots__/actions_menu.test.tsx.snap | 96 +++++-------------- .../components/actions_menu/actions_menu.tsx | 42 ++++---- 2 files changed, 40 insertions(+), 98 deletions(-) diff --git a/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap b/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap index ebc4b62266..2cf5aad0e8 100644 --- a/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap +++ b/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap @@ -7,30 +7,14 @@ exports[`components/actions_menu/ActionsMenu has actions - marketplace disabled onToggle={[Function]} open={true} > - - - - } + } > - + - - - - } + } > - + - - - - } + } > - + { this.buttonRef = React.createRef(); } - tooltip = ( - - - - ); - componentDidUpdate(prevProps: Props) { if (this.props.isMenuOpen && !prevProps.isMenuOpen) { this.fetchBindings(); @@ -131,7 +118,7 @@ export class ActionMenuClass extends React.PureComponent { } static getDerivedStateFromProps(props: Props) { - const state: Partial = { }; + const state: Partial = {}; if (props.appBindings) { state.appBindings = props.appBindings; } @@ -387,12 +374,15 @@ export class ActionMenuClass extends React.PureComponent { open={this.props.isMenuOpen} onToggle={this.handleDropdownOpened} > - + } placement='top' - overlay={this.tooltip} - rootClose={true} > - + { > {menuItems} - + ); } }