From 4c0eb09336644a5fed122acf85cf012de048c7eb Mon Sep 17 00:00:00 2001 From: MartinCupela <32706194+MartinCupela@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:36:19 +0100 Subject: [PATCH] fix(social-messenger): reflect the last message deletion in channel preview (#88) --- .../MessagingChannelPreview/MessagingChannelPreview.css | 4 ++++ .../MessagingChannelPreview/MessagingChannelPreview.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.css b/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.css index dbe0521b..9b01e3eb 100644 --- a/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.css +++ b/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.css @@ -82,6 +82,10 @@ white-space: nowrap; } +.channel-preview__content-message p { + margin: 0; +} + .channel-preview__container .str-chat__avatar { margin-right: 0; } diff --git a/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.tsx b/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.tsx index 99988cbe..3bf51747 100644 --- a/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.tsx +++ b/social-messenger-ts/src/components/MessagingChannelPreview/MessagingChannelPreview.tsx @@ -51,13 +51,15 @@ type MessagingChannelPreviewProps = ChannelPreviewUIComponentProps & { }; const MessagingChannelPreview = (props: MessagingChannelPreviewProps) => { - const { channel, lastMessage, setActiveChannel, onClick } = props; + const { channel, setActiveChannel, onClick, latestMessage, } = props; const { channel: activeChannel, client } = useChatContext(); const members = Object.values(channel.state.members).filter( ({ user }) => user?.id !== client.userID, ); + + return (
{

{getTimeStamp(channel)}

-

{lastMessage?.text ?? 'Send a message'}

+
{latestMessage}
);