mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 22:01: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) {
|
userListing(user: UserView) {
|
||||||
return [
|
return [
|
||||||
<span>
|
<span>
|
||||||
<UserListing user={user} />
|
<UserListing user={user} showApubName />
|
||||||
</span>,
|
</span>,
|
||||||
<span>{` - ${i18n.t('number_of_comments', {
|
<span>{` - ${i18n.t('number_of_comments', {
|
||||||
count: user.number_of_comments,
|
count: user.number_of_comments,
|
||||||
|
|
|
@ -21,6 +21,7 @@ interface UserListingProps {
|
||||||
useApubName?: boolean;
|
useApubName?: boolean;
|
||||||
muted?: boolean;
|
muted?: boolean;
|
||||||
hideAvatar?: boolean;
|
hideAvatar?: boolean;
|
||||||
|
showApubName?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UserListing extends Component<UserListingProps, any> {
|
export class UserListing extends Component<UserListingProps, any> {
|
||||||
|
@ -47,6 +48,10 @@ export class UserListing extends Component<UserListingProps, any> {
|
||||||
? user.preferred_username
|
? user.preferred_username
|
||||||
: apubName;
|
: apubName;
|
||||||
|
|
||||||
|
if (this.props.showApubName && !local && user.preferred_username) {
|
||||||
|
displayName = `${displayName} (${apubName})`;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Link
|
<Link
|
||||||
|
|
Loading…
Reference in a new issue