Skip to content

Commit

Permalink
fix: inverted unread indicator due to applied inverted styles (#2889)
Browse files Browse the repository at this point in the history
* fix: inverted unread indicator due to applied inverted styles

* fix: tests snapshots

* fix: unread indicator inverted issue on android

* fix: tests
  • Loading branch information
khushal87 authored Jan 15, 2025
1 parent 34ddec9 commit ba07bf9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions package/src/components/MessageList/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -670,33 +670,36 @@ const MessageListWithContext = <
threadList={threadList}
/>
);

return wrapMessageInTheme ? (
<>
<ThemeProvider mergedStyle={modifiedTheme}>
<View
style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}
testID={`message-list-item-${index}`}
>
{shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && (
<InlineUnreadIndicator />
)}
{shouldApplyAndroidWorkaround && renderDateSeperator}
{renderMessage}
</View>
</ThemeProvider>
{!shouldApplyAndroidWorkaround && renderDateSeperator}
{/* Adding indicator below the messages, since the list is inverted */}
{insertInlineUnreadIndicator && <InlineUnreadIndicator />}
{!shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && <InlineUnreadIndicator />}
</>
) : (
<>
<View
style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}
testID={`message-list-item-${index}`}
>
{shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && <InlineUnreadIndicator />}
{shouldApplyAndroidWorkaround && renderDateSeperator}
{renderMessage}
</View>
{!shouldApplyAndroidWorkaround && renderDateSeperator}
{/* Adding indicator below the messages, since the list is inverted */}
{insertInlineUnreadIndicator && <InlineUnreadIndicator />}
{!shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && <InlineUnreadIndicator />}
</>
);
};
Expand Down

0 comments on commit ba07bf9

Please sign in to comment.