fixing federated community / cross-post display links. Fixes #75

This commit is contained in:
Dessalines 2020-11-16 16:19:10 -06:00
parent fb45345bb2
commit c98a108ee3
2 changed files with 26 additions and 7 deletions

View file

@ -617,7 +617,13 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
</li> </li>
{this.props.post.duplicates.map(post => ( {this.props.post.duplicates.map(post => (
<li className="list-inline-item mr-2"> <li className="list-inline-item mr-2">
<Link to={`/post/${post.id}`}>{post.community_name}</Link> <Link to={`/post/${post.id}`}>
{post.community_local
? post.community_name
: `${post.community_name}@${hostname(
post.community_actor_id
)}`}
</Link>
</li> </li>
))} ))}
</> </>

View file

@ -55,6 +55,7 @@ import { UserDetails } from './user-details';
import { MarkdownTextArea } from './markdown-textarea'; import { MarkdownTextArea } from './markdown-textarea';
import { ImageUploadForm } from './image-upload-form'; import { ImageUploadForm } from './image-upload-form';
import { BannerIconHeader } from './banner-icon-header'; import { BannerIconHeader } from './banner-icon-header';
import { CommunityLink } from './community-link';
interface UserState { interface UserState {
userRes: UserDetailsResponse; userRes: UserDetailsResponse;
@ -841,9 +842,15 @@ export class User extends Component<any, UserState> {
<ul class="list-unstyled mb-0"> <ul class="list-unstyled mb-0">
{this.state.userRes.moderates.map(community => ( {this.state.userRes.moderates.map(community => (
<li> <li>
<Link to={`/c/${community.community_name}`}> <CommunityLink
{community.community_name} community={{
</Link> name: community.community_name,
id: community.community_id,
local: community.community_local,
actor_id: community.community_actor_id,
icon: community.community_icon,
}}
/>
</li> </li>
))} ))}
</ul> </ul>
@ -864,9 +871,15 @@ export class User extends Component<any, UserState> {
<ul class="list-unstyled mb-0"> <ul class="list-unstyled mb-0">
{this.state.userRes.follows.map(community => ( {this.state.userRes.follows.map(community => (
<li> <li>
<Link to={`/c/${community.community_name}`}> <CommunityLink
{community.community_name} community={{
</Link> name: community.community_name,
id: community.community_id,
local: community.community_local,
actor_id: community.community_actor_id,
icon: community.community_icon,
}}
/>
</li> </li>
))} ))}
</ul> </ul>