mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2025-01-09 19:52:36 +00:00
Fixing user link in search page. Fixes #74
This commit is contained in:
parent
4836da9d64
commit
3e87e61c0c
1 changed files with 13 additions and 31 deletions
|
@ -314,22 +314,7 @@ export class Search extends Component<any, SearchState> {
|
||||||
<div>{this.communityListing(i.data as Community)}</div>
|
<div>{this.communityListing(i.data as Community)}</div>
|
||||||
)}
|
)}
|
||||||
{i.type_ == 'users' && (
|
{i.type_ == 'users' && (
|
||||||
<div>
|
<div>{this.userListing(i.data as UserView)}</div>
|
||||||
<span>
|
|
||||||
@
|
|
||||||
<UserListing
|
|
||||||
user={{
|
|
||||||
name: (i.data as UserView).name,
|
|
||||||
preferred_username: (i.data as UserView)
|
|
||||||
.preferred_username,
|
|
||||||
avatar: (i.data as UserView).avatar,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<span>{` - ${i18n.t('number_of_comments', {
|
|
||||||
count: (i.data as UserView).number_of_comments,
|
|
||||||
})}`}</span>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -368,7 +353,6 @@ export class Search extends Component<any, SearchState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo possibly create UserListing and CommunityListing
|
|
||||||
communities() {
|
communities() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -396,25 +380,23 @@ export class Search extends Component<any, SearchState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userListing(user: UserView) {
|
||||||
|
return [
|
||||||
|
<span>
|
||||||
|
<UserListing user={user} />
|
||||||
|
</span>,
|
||||||
|
<span>{` - ${i18n.t('number_of_comments', {
|
||||||
|
count: user.number_of_comments,
|
||||||
|
})}`}</span>,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
users() {
|
users() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{this.state.searchResponse.users.map(user => (
|
{this.state.searchResponse.users.map(user => (
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">{this.userListing(user)}</div>
|
||||||
<span>
|
|
||||||
@
|
|
||||||
<UserListing
|
|
||||||
user={{
|
|
||||||
name: user.name,
|
|
||||||
avatar: user.avatar,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<span>{` - ${i18n.t('number_of_comments', {
|
|
||||||
count: user.number_of_comments,
|
|
||||||
})}`}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in a new issue