From: Dessalines Date: Wed, 18 Nov 2020 16:27:50 +0000 (-0600) Subject: Fixing user link in search page. Fixes #74 X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/save/%22%7B%7D/static/%7BrepoUrl%7D?a=commitdiff_plain;h=3e87e61c0cd62dde5ce191dac40ef63209cdc596;p=lemmy-ui.git Fixing user link in search page. Fixes #74 --- diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index 0bda38e..0dd4748 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -314,22 +314,7 @@ export class Search extends Component {
{this.communityListing(i.data as Community)}
)} {i.type_ == 'users' && ( -
- - @ - - - {` - ${i18n.t('number_of_comments', { - count: (i.data as UserView).number_of_comments, - })}`} -
+
{this.userListing(i.data as UserView)}
)} @@ -368,7 +353,6 @@ export class Search extends Component { ); } - // Todo possibly create UserListing and CommunityListing communities() { return ( <> @@ -396,25 +380,23 @@ export class Search extends Component { ); } + userListing(user: UserView) { + return [ + + + , + {` - ${i18n.t('number_of_comments', { + count: user.number_of_comments, + })}`}, + ]; + } + users() { return ( <> {this.state.searchResponse.users.map(user => (
-
- - @ - - - {` - ${i18n.t('number_of_comments', { - count: user.number_of_comments, - })}`} -
+
{this.userListing(user)}
))}