Further shorten name text if displayName === username
This commit is contained in:
parent
39efda9e38
commit
39a5634112
|
@ -6,11 +6,13 @@ import states from '../utils/states';
|
|||
import Avatar from './avatar';
|
||||
|
||||
function NameText({ account, showAvatar, showAcct, short, external }) {
|
||||
const { acct, avatar, avatarStatic, id, url, displayName, username, emojis } =
|
||||
account;
|
||||
const { acct, avatar, avatarStatic, id, url, displayName, emojis } = account;
|
||||
let { username } = account;
|
||||
|
||||
const displayNameWithEmoji = emojifyText(displayName, emojis);
|
||||
|
||||
if (username === displayName) username = null;
|
||||
|
||||
return (
|
||||
<a
|
||||
class={`name-text ${short ? 'short' : ''}`}
|
||||
|
@ -35,7 +37,7 @@ function NameText({ account, showAvatar, showAcct, short, external }) {
|
|||
__html: displayNameWithEmoji,
|
||||
}}
|
||||
/>
|
||||
{!showAcct && (
|
||||
{!showAcct && username && (
|
||||
<>
|
||||
{' '}
|
||||
<i>@{username}</i>
|
||||
|
|
Loading…
Reference in a new issue