fix(mentions): render actual user nicknames in @mention display
- Add displayName variable using atData.nickname with fallback to generic text
- Replace hardcoded '@所有人 ' and '@某人 ' with dynamic '@{displayName} ' format
This commit is contained in:
@@ -61,6 +61,7 @@ const PostContentRenderer: React.FC<PostContentRendererProps> = ({
|
||||
const atData = segment.data as AtSegmentData;
|
||||
const userId = atData?.user_id;
|
||||
const isAtAll = userId === 'all';
|
||||
const displayName = atData?.nickname || (isAtAll ? '所有人' : '某人');
|
||||
elements.push(
|
||||
<Text
|
||||
key={key}
|
||||
@@ -72,7 +73,7 @@ const PostContentRenderer: React.FC<PostContentRendererProps> = ({
|
||||
},
|
||||
]}
|
||||
>
|
||||
{isAtAll ? '@所有人 ' : '@某人 '}
|
||||
@{displayName}{' '}
|
||||
</Text>
|
||||
);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user