Skip to content

Commit

Permalink
Merge pull request #21779 from StevenKKC/fixTwoSameEmailDisplay
Browse files Browse the repository at this point in the history
fix two same emails display for user without display name
  • Loading branch information
marcochavezf authored Jun 30, 2023
2 parents 363ad9a + 222ee2e commit 4655d9c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/components/MentionSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function MentionSuggestions(props) {
const renderSuggestionMenuItem = (item) => {
const isIcon = item.text === CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT;
const styledDisplayName = getStyledTextArray(item.text, props.prefix);
const styledHandle = getStyledTextArray(item.alternateText, props.prefix);
const styledHandle = item.text === item.alternateText ? '' : getStyledTextArray(item.alternateText, props.prefix);

return (
<View style={[styles.autoCompleteSuggestionContainer, styles.ph2]}>
Expand Down Expand Up @@ -95,14 +95,18 @@ function MentionSuggestions(props) {
style={[styles.mentionSuggestionsText, styles.flex1]}
numberOfLines={1}
>
{_.map(styledHandle, ({text, isColored}, i) => (
<Text
key={`${text}${i}`}
style={[StyleUtils.getColoredBackgroundStyle(isColored), styles.mentionSuggestionsHandle, {...(isColored && {color: styles.text})}]}
>
{text}
</Text>
))}
{_.map(
styledHandle,
({text, isColored}, i) =>
text !== '' && (
<Text
key={`${text}${i}`}
style={[StyleUtils.getColoredBackgroundStyle(isColored), styles.mentionSuggestionsHandle, {...(isColored && {color: styles.text})}]}
>
{text}
</Text>
),
)}
</Text>
</View>
);
Expand Down

0 comments on commit 4655d9c

Please sign in to comment.