Skip to content

Commit

Permalink
fix(social-messenger): reflect the last message deletion in channel p…
Browse files Browse the repository at this point in the history
…review (#88)
  • Loading branch information
MartinCupela authored Nov 28, 2023
1 parent d625bd1 commit 4c0eb09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
white-space: nowrap;
}

.channel-preview__content-message p {
margin: 0;
}

.channel-preview__container .str-chat__avatar {
margin-right: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<StreamChatGenerics>();

const members = Object.values(channel.state.members).filter(
({ user }) => user?.id !== client.userID,
);



return (
<div
className={
Expand All @@ -78,7 +80,7 @@ const MessagingChannelPreview = (props: MessagingChannelPreviewProps) => {
</p>
<p className='channel-preview__content-time'>{getTimeStamp(channel)}</p>
</div>
<p className='channel-preview__content-message'>{lastMessage?.text ?? 'Send a message'}</p>
<div className='channel-preview__content-message'>{latestMessage}</div>
</div>
</div>
);
Expand Down

0 comments on commit 4c0eb09

Please sign in to comment.