From: Dessalines Date: Wed, 18 Nov 2020 22:01:05 +0000 (-0600) Subject: Have option to show apub shortname in parenthesis. X-Git-Url: http://these/git/readmes/%7B%7D/static/%7B%60https:/%7Bthis.props.banner%7D?a=commitdiff_plain;h=b1e283d5decd4467cefad6becbfed56690537621;p=lemmy-ui.git Have option to show apub shortname in parenthesis. Only used in the search page. --- diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index 0dd4748..6796ad3 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -383,7 +383,7 @@ export class Search extends Component { userListing(user: UserView) { return [ - + , {` - ${i18n.t('number_of_comments', { count: user.number_of_comments, diff --git a/src/shared/components/user-listing.tsx b/src/shared/components/user-listing.tsx index 43fa16e..a8e4025 100644 --- a/src/shared/components/user-listing.tsx +++ b/src/shared/components/user-listing.tsx @@ -21,6 +21,7 @@ interface UserListingProps { useApubName?: boolean; muted?: boolean; hideAvatar?: boolean; + showApubName?: boolean; } export class UserListing extends Component { @@ -47,6 +48,10 @@ export class UserListing extends Component { ? user.preferred_username : apubName; + if (this.props.showApubName && !local && user.preferred_username) { + displayName = `${displayName} (${apubName})`; + } + return ( <>