From: Dessalines Date: Wed, 21 Sep 2022 14:04:57 +0000 (-0400) Subject: Show create post even if not subscribed. Fixes #768 (#789) X-Git-Url: http://these/git/%7B?a=commitdiff_plain;h=61b68104668f1cb2d5ae0df314055402f1bd0a65;p=lemmy-ui.git Show create post even if not subscribed. Fixes #768 (#789) --- diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index 775fd63..84879d7 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -97,6 +97,7 @@ export class Sidebar extends Component { {this.adminButtons()} {this.subscribe()} {this.canPost && this.createPost()} + {this.blockCommunity()}
@@ -273,49 +274,55 @@ export class Sidebar extends Component { createPost() { let cv = this.props.community_view; return ( - cv.subscribed == SubscribedType.Subscribed && ( - - {i18n.t("create_a_post")} - - ) + + {i18n.t("create_a_post")} + ); } subscribe() { let community_view = this.props.community_view; - let blocked = this.props.community_view.blocked; return (
{community_view.subscribed == SubscribedType.NotSubscribed && ( - <> + + )} +
+ ); + } + + blockCommunity() { + let community_view = this.props.community_view; + let blocked = this.props.community_view.blocked; + + return ( +
+ {community_view.subscribed == SubscribedType.NotSubscribed && + (blocked ? ( - {blocked ? ( - - ) : ( - - )} - - )} + ) : ( + + ))}
); }