mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-22 05:39:20 +01:00
Further shorten name text if displayName === username
This commit is contained in:
parent
39efda9e38
commit
39a5634112
1 changed files with 5 additions and 3 deletions
|
@ -6,11 +6,13 @@ import states from '../utils/states';
|
||||||
import Avatar from './avatar';
|
import Avatar from './avatar';
|
||||||
|
|
||||||
function NameText({ account, showAvatar, showAcct, short, external }) {
|
function NameText({ account, showAvatar, showAcct, short, external }) {
|
||||||
const { acct, avatar, avatarStatic, id, url, displayName, username, emojis } =
|
const { acct, avatar, avatarStatic, id, url, displayName, emojis } = account;
|
||||||
account;
|
let { username } = account;
|
||||||
|
|
||||||
const displayNameWithEmoji = emojifyText(displayName, emojis);
|
const displayNameWithEmoji = emojifyText(displayName, emojis);
|
||||||
|
|
||||||
|
if (username === displayName) username = null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
class={`name-text ${short ? 'short' : ''}`}
|
class={`name-text ${short ? 'short' : ''}`}
|
||||||
|
@ -35,7 +37,7 @@ function NameText({ account, showAvatar, showAcct, short, external }) {
|
||||||
__html: displayNameWithEmoji,
|
__html: displayNameWithEmoji,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{!showAcct && (
|
{!showAcct && username && (
|
||||||
<>
|
<>
|
||||||
{' '}
|
{' '}
|
||||||
<i>@{username}</i>
|
<i>@{username}</i>
|
||||||
|
|
Loading…
Reference in a new issue