Have option to show apub shortname in parenthesis.

Only used in the search page.
This commit is contained in:
Dessalines 2020-11-18 16:01:05 -06:00
parent 8ef5ce0860
commit b1e283d5de
2 changed files with 6 additions and 1 deletions

View 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,

View 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