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,21 +1,20 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import React, { memo } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { MediaGallery } from '../../components/conversation/media-gallery/MediaGallery';
|
||||
import { getMediaGalleryState } from '../selectors/mediaGallery';
|
||||
import { useConversationsActions } from '../ducks/conversations';
|
||||
import { useLightboxActions } from '../ducks/lightbox';
|
||||
|
||||
import { useMediaGalleryActions } from '../ducks/mediaGallery';
|
||||
|
||||
export type PropsType = {
|
||||
conversationId: string;
|
||||
};
|
||||
|
||||
export function SmartAllMedia({ conversationId }: PropsType): JSX.Element {
|
||||
export const SmartAllMedia = memo(function SmartAllMedia({
|
||||
conversationId,
|
||||
}: PropsType) {
|
||||
const { media, documents } = useSelector(getMediaGalleryState);
|
||||
const { loadMediaItems } = useMediaGalleryActions();
|
||||
const { saveAttachment } = useConversationsActions();
|
||||
|
@ -32,4 +31,4 @@ export function SmartAllMedia({ conversationId }: PropsType): JSX.Element {
|
|||
saveAttachment={saveAttachment}
|
||||
/>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue