From a80c6d89a80ceb46925d34678bb7611702fae817 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Wed, 21 Dec 2022 15:44:23 -0500 Subject: [PATCH] Moves message details into React pane land --- ts/background.ts | 27 +-- ts/components/CompositionArea.tsx | 2 +- .../conversation/ConversationHeader.tsx | 25 +-- ts/components/conversation/Message.tsx | 21 +- ts/components/conversation/MessageAudio.tsx | 3 +- .../conversation/MessageMetadata.tsx | 8 +- .../conversation/TimelineMessage.tsx | 32 +-- .../ConversationDetails.tsx | 12 +- ts/models/messages.ts | 144 ------------- ts/signal.ts | 2 - ts/state/ducks/accounts.ts | 6 + ts/state/ducks/conversations.ts | 170 +++++++++++----- ts/state/roots/createMessageDetail.tsx | 19 -- ts/state/selectors/conversations.ts | 21 +- ts/state/selectors/message.ts | 192 +++++++++++++++++- ts/state/smart/ConversationView.tsx | 19 +- ts/state/smart/MessageDetail.tsx | 134 +++++++----- ts/types/Panels.ts | 52 +++-- ts/views/conversation_view.tsx | 168 --------------- ts/window.d.ts | 2 - 20 files changed, 501 insertions(+), 558 deletions(-) delete mode 100644 ts/state/roots/createMessageDetail.tsx diff --git a/ts/background.ts b/ts/background.ts index 1446710cf..57347380c 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -1460,9 +1460,7 @@ export async function startApp(): Promise { // Send Escape to active conversation so it can close panels if (conversation && key === 'Escape') { - window.reduxActions.conversations.popPanelForConversation( - conversation.id - ); + window.reduxActions.conversations.popPanelForConversation(); event.preventDefault(); event.stopPropagation(); return; @@ -1536,12 +1534,9 @@ export async function startApp(): Promise { shiftKey && (key === 'm' || key === 'M') ) { - window.reduxActions.conversations.pushPanelForConversation( - conversation.id, - { - type: PanelType.AllMedia, - } - ); + window.reduxActions.conversations.pushPanelForConversation({ + type: PanelType.AllMedia, + }); event.preventDefault(); event.stopPropagation(); return; @@ -1634,14 +1629,12 @@ export async function startApp(): Promise { return; } - window.reduxActions.conversations.pushPanelForConversation( - conversation.id, - { - type: PanelType.MessageDetails, - args: { messageId: selectedMessage }, - } - ); - + window.reduxActions.conversations.pushPanelForConversation({ + type: PanelType.MessageDetails, + args: { + messageId: selectedMessage, + }, + }); return; } diff --git a/ts/components/CompositionArea.tsx b/ts/components/CompositionArea.tsx index 08185d600..139711e7e 100644 --- a/ts/components/CompositionArea.tsx +++ b/ts/components/CompositionArea.tsx @@ -462,7 +462,7 @@ export function CompositionArea({ recentStickers={recentStickers} clearInstalledStickerPack={clearInstalledStickerPack} onClickAddPack={() => - pushPanelForConversation(conversationId, { + pushPanelForConversation({ type: PanelType.StickerManager, }) } diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index 3b19fac5c..92fe9ebe2 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -154,12 +154,12 @@ export class ConversationHeader extends React.Component { } private renderBackButton(): ReactNode { - const { i18n, id, popPanelForConversation, showBackButton } = this.props; + const { i18n, popPanelForConversation, showBackButton } = this.props; return (