diff options
author | Dessalines <tyhou13@gmx.com> | 2020-04-14 19:18:13 -0400 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-04-14 19:18:13 -0400 |
commit | fcf1c65fc131478632525ce44a792f1578932f4a (patch) | |
tree | b778be542d06aa374fd5eb9d36b40b2b7fb05536 /ui/src/components/post-listing.tsx | |
parent | 1336b4ed6023e7fcf0fd40be63569966ee4b1b45 (diff) |
Front end federation names and links for users, posts, and communities.
Diffstat (limited to 'ui/src/components/post-listing.tsx')
-rw-r--r-- | ui/src/components/post-listing.tsx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index 49749201..6ebf5400 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -20,6 +20,7 @@ import { MomentTime } from './moment-time'; import { PostForm } from './post-form'; import { IFramelyCard } from './iframely-card'; import { UserListing } from './user-listing'; +import { CommunityLink } from './community-link'; import { md, mdToHtml, @@ -420,6 +421,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> { user={{ name: post.creator_name, avatar: post.creator_avatar, + id: post.creator_id, + local: post.creator_local, + actor_id: post.creator_actor_id, }} /> {this.isMod && ( @@ -440,15 +444,14 @@ export class PostListing extends Component<PostListingProps, PostListingState> { {this.props.showCommunity && ( <span> <span> {i18n.t('to')} </span> - {post.local ? ( - <Link to={`/c/${post.community_name}`}> - {post.community_name} - </Link> - ) : ( - <a href={post.community_actor_id} target="_blank"> - {hostname(post.ap_id)}/{post.community_name} - </a> - )} + <CommunityLink + community={{ + name: post.community_name, + id: post.community_id, + local: post.community_local, + actor_id: post.community_actor_id, + }} + /> </span> )} </li> |