Skip to content

Commit ba07bf9

Browse files
authored
fix: inverted unread indicator due to applied inverted styles (#2889)
* fix: inverted unread indicator due to applied inverted styles * fix: tests snapshots * fix: unread indicator inverted issue on android * fix: tests
1 parent 34ddec9 commit ba07bf9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

package/src/components/MessageList/MessageList.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,33 +670,36 @@ const MessageListWithContext = <
670670
threadList={threadList}
671671
/>
672672
);
673+
673674
return wrapMessageInTheme ? (
674675
<>
675676
<ThemeProvider mergedStyle={modifiedTheme}>
676677
<View
677678
style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}
678679
testID={`message-list-item-${index}`}
679680
>
681+
{shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && (
682+
<InlineUnreadIndicator />
683+
)}
680684
{shouldApplyAndroidWorkaround && renderDateSeperator}
681685
{renderMessage}
682686
</View>
683687
</ThemeProvider>
684688
{!shouldApplyAndroidWorkaround && renderDateSeperator}
685-
{/* Adding indicator below the messages, since the list is inverted */}
686-
{insertInlineUnreadIndicator && <InlineUnreadIndicator />}
689+
{!shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && <InlineUnreadIndicator />}
687690
</>
688691
) : (
689692
<>
690693
<View
691694
style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}
692695
testID={`message-list-item-${index}`}
693696
>
697+
{shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && <InlineUnreadIndicator />}
694698
{shouldApplyAndroidWorkaround && renderDateSeperator}
695699
{renderMessage}
696700
</View>
697701
{!shouldApplyAndroidWorkaround && renderDateSeperator}
698-
{/* Adding indicator below the messages, since the list is inverted */}
699-
{insertInlineUnreadIndicator && <InlineUnreadIndicator />}
702+
{!shouldApplyAndroidWorkaround && insertInlineUnreadIndicator && <InlineUnreadIndicator />}
700703
</>
701704
);
702705
};

0 commit comments

Comments
 (0)