From: Dessalines Date: Tue, 28 Apr 2020 15:53:05 +0000 (-0400) Subject: Fix federated community link on search page. X-Git-Url: http://these/git/readmes/static/%7B%60/css/themes/%7Biframely.url%7D?a=commitdiff_plain;h=36d0e34668b94a955306a4b83947deb1f10689f2;p=lemmy.git Fix federated community link on search page. --- 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 ( <>