From 3e87e61c0cd62dde5ce191dac40ef63209cdc596 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 18 Nov 2020 10:27:50 -0600 Subject: [PATCH] Fixing user link in search page. Fixes #74 --- src/shared/components/search.tsx | 44 ++++++++++---------------------- 1 file changed, 13 insertions(+), 31 deletions(-) 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)}
))} -- 2.44.1