From 2e7cdfdb70e13684047ff2e51b94cf829aec135d Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Fri, 30 Jun 2023 10:11:27 -0400 Subject: [PATCH] UI Improvements to the edit history modal --- stylesheets/components/EditHistoryMessagesModal.scss | 1 + ts/components/EditHistoryMessagesModal.tsx | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/stylesheets/components/EditHistoryMessagesModal.scss b/stylesheets/components/EditHistoryMessagesModal.scss index 879bda27108..58ce9633386 100644 --- a/stylesheets/components/EditHistoryMessagesModal.scss +++ b/stylesheets/components/EditHistoryMessagesModal.scss @@ -3,6 +3,7 @@ .EditHistoryMessagesModal { &__divider { + border-bottom: 0; border-style: solid; margin-block: 24px; diff --git a/ts/components/EditHistoryMessagesModal.tsx b/ts/components/EditHistoryMessagesModal.tsx index 88246f447d6..d41bacd1ed4 100644 --- a/ts/components/EditHistoryMessagesModal.tsx +++ b/ts/components/EditHistoryMessagesModal.tsx @@ -60,7 +60,7 @@ const MESSAGE_DEFAULT_PROPS = { shouldHideMetadata: false, showContactModal: shouldNeverBeCalled, showConversation: noop, - showEditHistoryModal: shouldNeverBeCalled, + showEditHistoryModal: noop, showExpiredIncomingTapToViewToast: shouldNeverBeCalled, showExpiredOutgoingTapToViewToast: shouldNeverBeCalled, showLightboxForViewOnceMedia: shouldNeverBeCalled, @@ -100,6 +100,8 @@ export function EditHistoryMessagesModal({ const [currentMessage, ...pastEdits] = editHistoryMessages; const currentMessageId = `${currentMessage.id}.${currentMessage.timestamp}`; + let previousItem = currentMessage; + return (
+ - {pastEdits.map((messageAttributes, index) => { + {pastEdits.map(messageAttributes => { const syntheticId = `${messageAttributes.id}.${messageAttributes.timestamp}`; - const previousItem = pastEdits[index - 1]; - const shouldShowDateHeader = Boolean( !previousItem || // This comparison avoids strange header behavior for out-of-order messages. @@ -164,6 +166,8 @@ export function EditHistoryMessagesModal({ /> ) : null; + previousItem = messageAttributes; + return ( {dateHeaderElement}