From 36d0e34668b94a955306a4b83947deb1f10689f2 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 28 Apr 2020 11:53:05 -0400 Subject: [PATCH] Fix federated community link on search page. --- ui/src/components/search.tsx | 38 +++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/ui/src/components/search.tsx b/ui/src/components/search.tsx index b9662fae..c14f2448 100644 --- a/ui/src/components/search.tsx +++ b/ui/src/components/search.tsx @@ -22,8 +22,6 @@ import { fetchLimit, routeSearchTypeToEnum, routeSortTypeToEnum, - pictshareAvatarThumbnail, - showAvatars, toast, createCommentLikeRes, createPostLikeFindRes, @@ -31,6 +29,7 @@ import { } from '../utils'; import { PostListing } from './post-listing'; import { UserListing } from './user-listing'; +import { CommunityLink } from './community-link'; import { SortSelect } from './sort-select'; import { CommentNodes } from './comment-nodes'; import { i18n } from '../i18next'; @@ -253,16 +252,7 @@ export class Search extends Component { /> )} {i.type_ == 'communities' && ( -
- - {`/c/${ - (i.data as Community).name - }`} - - {` - ${(i.data as Community).title} - ${ - (i.data as Community).number_of_subscribers - } subscribers`} -
+
{this.communityListing(i.data as Community)}
)} {i.type_ == 'users' && (
@@ -316,20 +306,28 @@ export class Search extends Component { <> {this.state.searchResponse.communities.map(community => (
-
- - {`/c/${community.name}`} - - {` - ${community.title} - ${community.number_of_subscribers} subscribers`} -
+
{this.communityListing(community)}
))} ); } + communityListing(community: Community) { + return ( + <> + + + + {` - ${community.title} - + ${i18n.t('number_of_subscribers', { + count: community.number_of_subscribers, + })} + `} + + ); + } + users() { return ( <> -- 2.44.1