From: Dessalines Date: Wed, 5 May 2021 14:57:41 +0000 (-0400) Subject: Fix non-local community and person links. Fixes #290 X-Git-Url: http://these/git/?a=commitdiff_plain;h=fed9bddbb25216acd608a6231de4d28cb8be4a38;p=lemmy-ui.git Fix non-local community and person links. Fixes #290 --- diff --git a/src/shared/components/community-link.tsx b/src/shared/components/community-link.tsx index 5a85a12..c12f570 100644 --- a/src/shared/components/community-link.tsx +++ b/src/shared/components/community-link.tsx @@ -36,17 +36,34 @@ export class CommunityLink extends Component { let apubName = `!${name_}`; let displayName = this.props.useApubName ? apubName : title; - return ( + return !this.props.realLink ? ( + {this.avatarAndName(displayName)} + + ) : ( + + {this.avatarAndName(displayName)} + + ); + } + + avatarAndName(displayName: string) { + let community = this.props.community; + return ( + <> {!this.props.hideAvatar && community.icon && showAvatars() && ( )} {displayName} - + ); } } diff --git a/src/shared/components/person-listing.tsx b/src/shared/components/person-listing.tsx index fda388d..1726576 100644 --- a/src/shared/components/person-listing.tsx +++ b/src/shared/components/person-listing.tsx @@ -44,19 +44,38 @@ export class PersonListing extends Component { return ( <> - - {!this.props.hideAvatar && person.avatar && showAvatars() && ( - - )} - {displayName} - + {!this.props.realLink ? ( + + {this.avatarAndName(displayName)} + + ) : ( + + {this.avatarAndName(displayName)} + + )} {isCakeDay(person.published) && } ); } + + avatarAndName(displayName: string) { + let person = this.props.person; + return ( + <> + {!this.props.hideAvatar && person.avatar && showAvatars() && ( + + )} + {displayName} + + ); + } }