Have option to show apub shortname in parenthesis.
authorDessalines <tyhou13@gmx.com>
Wed, 18 Nov 2020 22:01:05 +0000 (16:01 -0600)
committerDessalines <tyhou13@gmx.com>
Wed, 18 Nov 2020 22:01:05 +0000 (16:01 -0600)
Only used in the search page.

src/shared/components/search.tsx
src/shared/components/user-listing.tsx

index 0dd47487b9bb80e858d2098c132bd31c929ecf42..6796ad3586304577458fc58c0910968b8aac6a3b 100644 (file)
@@ -383,7 +383,7 @@ export class Search extends Component<any, SearchState> {
   userListing(user: UserView) {
     return [
       <span>
-        <UserListing user={user} />
+        <UserListing user={user} showApubName />
       </span>,
       <span>{` - ${i18n.t('number_of_comments', {
         count: user.number_of_comments,
index 43fa16e27db52a5159c0445ea03bbeb84d09e74f..a8e4025f1e21502774390fe46ef221ba3768b171 100644 (file)
@@ -21,6 +21,7 @@ interface UserListingProps {
   useApubName?: boolean;
   muted?: boolean;
   hideAvatar?: boolean;
+  showApubName?: boolean;
 }
 
 export class UserListing extends Component<UserListingProps, any> {
@@ -47,6 +48,10 @@ export class UserListing extends Component<UserListingProps, any> {
       ? user.preferred_username
       : apubName;
 
+    if (this.props.showApubName && !local && user.preferred_username) {
+      displayName = `${displayName} (${apubName})`;
+    }
+
     return (
       <>
         <Link