mirror of
https://github.com/plebbit/seedit.git
synced 2026-06-11 17:46:27 -04:00
fix(posts): limit display name character count
This commit is contained in:
@@ -49,6 +49,7 @@ const PostAuthor = ({
|
||||
const isAuthorModerator = authorRole === 'moderator';
|
||||
const moderatorClass = `${isAuthorOwner ? styles.owner : isAuthorAdmin ? styles.admin : isAuthorModerator ? styles.moderator : ''}`;
|
||||
const authorRoleInitial = (isAuthorOwner && 'O') || (isAuthorAdmin && 'A') || (isAuthorModerator && 'M') || '';
|
||||
const shortDisplayName = displayName?.length > 20 ? displayName?.slice(0, 20) + '...' : displayName;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -60,7 +61,7 @@ const PostAuthor = ({
|
||||
) : (
|
||||
<> </>
|
||||
)}
|
||||
{displayName && <span className={`${styles.displayName} ${moderatorClass}`}>{displayName} </span>}
|
||||
{displayName && <span className={`${styles.displayName} ${moderatorClass}`}>{shortDisplayName} </span>}
|
||||
<span className={`${styles.authorAddressWrapper} ${moderatorClass}`}>
|
||||
<span className={styles.authorAddressHidden}>u/{shortAddress || shortAuthorAddress}</span>
|
||||
<span className={`${styles.authorAddressVisible} ${authorAddressChanged && styles.authorAddressChanged}`}>u/{shortAuthorAddress}</span>
|
||||
|
||||
@@ -39,6 +39,7 @@ const ReplyAuthor = ({ address, authorRole, cid, displayName, imageUrl, isAvatar
|
||||
const isAuthorModerator = authorRole === 'moderator';
|
||||
const authorRoleInitial = (isAuthorOwner && 'O') || (isAuthorAdmin && 'A') || (isAuthorModerator && 'M') || '';
|
||||
const moderatorClass = `${isAuthorOwner ? styles.owner : isAuthorAdmin ? styles.admin : isAuthorModerator ? styles.moderator : ''}`;
|
||||
const shortDisplayName = displayName?.length > 20 ? displayName?.slice(0, 20) + '...' : displayName;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -49,7 +50,7 @@ const ReplyAuthor = ({ address, authorRole, cid, displayName, imageUrl, isAvatar
|
||||
)}
|
||||
{displayName && (
|
||||
<Link to={`/u/${address}/c/${cid}`} className={`${styles.author} ${moderatorClass}`}>
|
||||
{displayName}{' '}
|
||||
{shortDisplayName}{' '}
|
||||
</Link>
|
||||
)}
|
||||
<Link to={`/u/${address}/c/${cid}`} className={`${styles.author} ${moderatorClass}`}>
|
||||
|
||||
Reference in New Issue
Block a user