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,6 +1,6 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import React, { useCallback } from 'react';
|
||||
import React, { memo, useCallback } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { MessageAudio } from '../../components/conversation/MessageAudio';
|
||||
|
@ -26,10 +26,10 @@ export type Props = Omit<MessageAudioOwnProps, 'active' | 'onPlayMessage'> & {
|
|||
renderingContext: string;
|
||||
};
|
||||
|
||||
export function SmartMessageAudio({
|
||||
export const SmartMessageAudio = memo(function SmartMessageAudio({
|
||||
renderingContext,
|
||||
...props
|
||||
}: Props): JSX.Element | null {
|
||||
}: Props) {
|
||||
const active = useSelector(selectAudioPlayerActive);
|
||||
const { loadVoiceNoteAudio, setIsPlaying, setPlaybackRate, setPosition } =
|
||||
useAudioPlayerActions();
|
||||
|
@ -100,4 +100,4 @@ export function SmartMessageAudio({
|
|||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue