From 1b706e020222292f3797b146c5379e1c5805561c Mon Sep 17 00:00:00 2001 From: Dipan Dhali <121673023+dipandhali2021@users.noreply.github.com> Date: Mon, 30 Oct 2023 08:26:53 +0000 Subject: [PATCH] [MM-54799] Convert ./components/widgets/menu/menu_header.tsx from Class Component to Function Component (#24847) * Converted Menu Header to function Component * Converted MenuHeader to Function Component an d fixed test file * Added deprecated line * added jsdoc above the component * Added Suggested Changes --------- Co-authored-by: Mattermost Build --- .../status_dropdown.test.tsx.snap | 36 +++++++++---------- .../components/widgets/menu/menu_header.tsx | 25 ++++++------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap b/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap index a2713e43e4..618ab90559 100644 --- a/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap +++ b/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap @@ -37,7 +37,7 @@ exports[`components/StatusDropdown should match snapshot in default state 1`] = id="statusDropdownMenu" listId="status-drop-down-menu-list" > -
-
+ -
-
+ -
-
+ -
-
+ -
-
+ - - + -
-
+ -
-
+ -
-
+ void; } @@ -14,17 +13,15 @@ type Props = { /** * @deprecated Use the "webapp/channels/src/components/menu" instead. */ -export default class MenuHeader extends React.PureComponent { - public render() { - const {children, onClick} = this.props; +const MenuHeader = ({children, onClick}: Props) => { + return ( +
  • + {children} +
  • + ); +}; - return ( -
  • - {children} -
  • - ); - } -} +export default React.memo(MenuHeader);