Skip to content

Commit

Permalink
Merge pull request #2712 from GetStream/develop
Browse files Browse the repository at this point in the history
Next Release
  • Loading branch information
isekovanic authored Oct 21, 2024
2 parents 546272a + fdb4f17 commit 004f663
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion package/src/components/MessageList/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,9 @@ const MessageListWithContext = <
});
}
// the message we want to scroll to has not been loaded in the state yet
loadChannelAroundMessage({ messageId: messageIdToScroll });
if (indexOfParentInMessageList === -1) {
loadChannelAroundMessage({ messageId: messageIdToScroll });
}
}, 50);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [targetedMessage, initialScrollToFirstUnreadMessage]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,9 @@ describe('MessageList', () => {
mockedLongMessagesList.push(generateMessage({ timestamp: new Date(), user: user1 }));
}
// could be any message that is not within the initially processed ones
const { id: targetedMessageId, text: targetedMessageText } = mockedLongMessagesList[3];
const latestMessageText = mockedLongMessagesList[mockedLongMessagesList.length - 1].text;
const latestMessageText = mockedLongMessagesList[0].text;
const { id: targetedMessageId, text: targetedMessageText } =
mockedLongMessagesList[mockedLongMessagesList.length - 4];

const mockedChannel = generateChannelResponse({
members: [generateMember({ user: user1 })],
Expand Down
8 changes: 5 additions & 3 deletions package/src/components/MessageOverlay/MessageOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ const MessageOverlayWithContext = <
);

const {
colors: { blue_alice, grey_gainsboro, grey_whisper, transparent, white_smoke },
colors: { blue_alice, grey_gainsboro, grey_whisper, transparent },
messageSimple: {
content: {
container: { borderRadiusL, borderRadiusS },
containerInner,
receiverMessageBackgroundColor,
replyContainer,
senderMessageBackgroundColor,
},
},
overlay: { container: containerStyle, padding: overlayPadding },
Expand Down Expand Up @@ -360,8 +362,8 @@ const MessageOverlayWithContext = <
: grey_gainsboro
: blue_alice
: alignment === 'left'
? white_smoke
: grey_gainsboro,
? receiverMessageBackgroundColor
: senderMessageBackgroundColor,
borderBottomLeftRadius:
(groupStyle === 'left_bottom' || groupStyle === 'left_single') &&
(!hasThreadReplies || threadList)
Expand Down
2 changes: 2 additions & 0 deletions package/src/contexts/themeContext/utils/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,10 @@ export const defaultTheme: Theme = {
metaText: {
fontSize: 12,
},
receiverMessageBackgroundColor: Colors.white,
replyBorder: {},
replyContainer: {},
senderMessageBackgroundColor: Colors.grey_gainsboro,
textContainer: {
onlyEmojiMarkdown: { text: { fontSize: 50 } },
},
Expand Down

0 comments on commit 004f663

Please sign in to comment.