diff --git a/ui/src/components/search.tsx b/ui/src/components/search.tsx index b9662fae3..c14f2448e 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 ( <>