diff --git a/webapp/channels/src/components/post_view/new_message_separator/new_message_separator.tsx b/webapp/channels/src/components/post_view/new_message_separator/new_message_separator.tsx index 7b068b93fd..eb5b2682f4 100644 --- a/webapp/channels/src/components/post_view/new_message_separator/new_message_separator.tsx +++ b/webapp/channels/src/components/post_view/new_message_separator/new_message_separator.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; +import React, {memo} from 'react'; import {FormattedMessage} from 'react-intl'; import NotificationSeparator from 'components/widgets/separator/notification-separator'; @@ -17,38 +17,45 @@ type Props = { threadId?: string; } -export default class NewMessageSeparator extends React.PureComponent { - render(): JSX.Element { - const pluginItems = this.props.newMessagesSeparatorActions?. - map((item) => { - if (!item.component) { - return null; - } +const NewMessageSeparator = ({ + newMessagesSeparatorActions, + lastViewedAt, + channelId, + threadId, + wrapperRef, + separatorId, +}: Props) => { + const pluginItems = newMessagesSeparatorActions?. + map((item) => { + if (!item.component) { + return null; + } - const Component = item.component as any; - return ( - - ); - }); + const Component = item.component as any; + return ( + + ); + }); - return ( -
- - - {pluginItems} - -
- ); - } -} + return ( +
+ + + {pluginItems} + +
+ ); +}; + +export default memo(NewMessageSeparator); diff --git a/webapp/channels/src/components/post_view/post_list_row/__snapshots__/post_list_row.test.tsx.snap b/webapp/channels/src/components/post_view/post_list_row/__snapshots__/post_list_row.test.tsx.snap index c5959855b3..5f7fb2384a 100644 --- a/webapp/channels/src/components/post_view/post_list_row/__snapshots__/post_list_row.test.tsx.snap +++ b/webapp/channels/src/components/post_view/post_list_row/__snapshots__/post_list_row.test.tsx.snap @@ -93,7 +93,7 @@ exports[`components/post_view/post_list_row should render more messages loading `; exports[`components/post_view/post_list_row should render new messages line 1`] = ` -