Refactor smart components
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
05c09ef769
commit
27b55e472d
109 changed files with 3583 additions and 2629 deletions
|
@ -1,9 +1,7 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import React, { memo, useMemo } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { CollidingAvatars } from '../../components/CollidingAvatars';
|
||||
import { getIntl } from '../selectors/user';
|
||||
import { getConversationSelector } from '../selectors/conversations';
|
||||
|
@ -12,9 +10,9 @@ export type PropsType = Readonly<{
|
|||
conversationIds: ReadonlyArray<string>;
|
||||
}>;
|
||||
|
||||
export function SmartCollidingAvatars({
|
||||
export const SmartCollidingAvatars = memo(function SmartCollidingAvatars({
|
||||
conversationIds,
|
||||
}: PropsType): JSX.Element {
|
||||
}: PropsType) {
|
||||
const i18n = useSelector(getIntl);
|
||||
const getConversation = useSelector(getConversationSelector);
|
||||
|
||||
|
@ -25,4 +23,4 @@ export function SmartCollidingAvatars({
|
|||
}, [conversationIds, getConversation]);
|
||||
|
||||
return <CollidingAvatars i18n={i18n} conversations={conversations} />;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue