mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-29 07:41:13 +00:00
Have option to show apub shortname in parenthesis.
Only used in the search page.
This commit is contained in:
parent
8ef5ce0860
commit
b1e283d5de
2 changed files with 6 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue