diff --git a/.changeset/fuzzy-plums-travel.md b/.changeset/fuzzy-plums-travel.md new file mode 100644 index 0000000000000000000000000000000000000000..fec86862a7117ba5347cdeb61f6a09872df8b4b4 --- /dev/null +++ b/.changeset/fuzzy-plums-travel.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/gazzodown": patch +--- + +fixed an issue with mentions showing usernames instead of names on smaller screens diff --git a/packages/gazzodown/src/mentions/UserMentionElement.tsx b/packages/gazzodown/src/mentions/UserMentionElement.tsx index 308363309aa29ce4c7f5fb93df02635ed4567c25..a25106918af8a94730241e8d73fd5fcf0a6a6b8d 100644 --- a/packages/gazzodown/src/mentions/UserMentionElement.tsx +++ b/packages/gazzodown/src/mentions/UserMentionElement.tsx @@ -13,14 +13,11 @@ const handleUserMention = (mention: string | undefined, withSymbol: boolean | un const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement => { const t = useTranslation(); - const { resolveUserMention, onUserMentionClick, isMobile, ownUserId, useRealName, showMentionSymbol } = - useContext(MarkupInteractionContext); + const { resolveUserMention, onUserMentionClick, ownUserId, useRealName, showMentionSymbol } = useContext(MarkupInteractionContext); const resolved = useMemo(() => resolveUserMention?.(mention), [mention, resolveUserMention]); const handleClick = useMemo(() => (resolved ? onUserMentionClick?.(resolved) : undefined), [resolved, onUserMentionClick]); - const showRealName = useRealName && !isMobile; - if (mention === 'all') { return ( <Message.Highlight title={t('Mentions_all_room_members')} variant='relevant'> @@ -49,7 +46,7 @@ const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement onClick={handleClick} data-uid={resolved._id} > - {handleUserMention((showRealName ? resolved.name : resolved.username) ?? mention, showMentionSymbol)} + {handleUserMention((useRealName ? resolved.name : resolved.username) ?? mention, showMentionSymbol)} </Message.Highlight> ); };