From 4ec573c3fba09a0ac96a0057775baa484d0d0aec Mon Sep 17 00:00:00 2001 From: Dipan Dhali <121673023+dipandhali2021@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:52:07 +0530 Subject: [PATCH] [MM-54793] Convert ./components/widgets/separator/notification-separator.tsx to Function Component (#24887) * Converted Notification Seperator to function component * Fixed lint error --------- Co-authored-by: Mattermost Build --- .../separator/notification-separator.tsx | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/webapp/channels/src/components/widgets/separator/notification-separator.tsx b/webapp/channels/src/components/widgets/separator/notification-separator.tsx index 987e45a26e..2ceaaac41e 100644 --- a/webapp/channels/src/components/widgets/separator/notification-separator.tsx +++ b/webapp/channels/src/components/widgets/separator/notification-separator.tsx @@ -5,22 +5,23 @@ import React from 'react'; import './separator.scss'; import './notification-separator.scss'; -export default class NotificationSeparator extends React.PureComponent> { - public render() { - const {children} = this.props; - return ( -
-
- {children && ( -
- {children} -
- )} -
- ); - } -} +type Props = React.PropsWithChildren; + +const NotificationSeparator = ({children}: Props) => { + return ( +
+
+ {children && ( +
+ {children} +
+ )} +
+ ); +}; + +export default React.memo(NotificationSeparator);