Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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