mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Use display titles for community links. Fixes #98
This commit is contained in:
parent
b8c3c2bcd4
commit
f2999df300
1 changed files with 4 additions and 2 deletions
|
@ -20,20 +20,22 @@ export class CommunityLink extends Component<CommunityLinkProps, any> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let community = this.props.community;
|
let community = this.props.community;
|
||||||
let name_: string, link: string;
|
let name_: string, title: string, link: string;
|
||||||
let local = community.local == null ? true : community.local;
|
let local = community.local == null ? true : community.local;
|
||||||
if (local) {
|
if (local) {
|
||||||
name_ = community.name;
|
name_ = community.name;
|
||||||
|
title = community.title;
|
||||||
link = `/c/${community.name}`;
|
link = `/c/${community.name}`;
|
||||||
} else {
|
} else {
|
||||||
name_ = `${community.name}@${hostname(community.actor_id)}`;
|
name_ = `${community.name}@${hostname(community.actor_id)}`;
|
||||||
|
title = `${community.title}@${hostname(community.actor_id)}`;
|
||||||
link = !this.props.realLink
|
link = !this.props.realLink
|
||||||
? `/community/${community.id}`
|
? `/community/${community.id}`
|
||||||
: community.actor_id;
|
: community.actor_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
let apubName = `!${name_}`;
|
let apubName = `!${name_}`;
|
||||||
let displayName = this.props.useApubName ? apubName : name_;
|
let displayName = this.props.useApubName ? apubName : title;
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
title={apubName}
|
title={apubName}
|
||||||
|
|
Loading…
Reference in a new issue