From 61b68104668f1cb2d5ae0df314055402f1bd0a65 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 21 Sep 2022 10:04:57 -0400 Subject: [PATCH] Show create post even if not subscribed. Fixes #768 (#789) --- src/shared/components/community/sidebar.tsx | 71 +++++++++++---------- 1 file changed, 39 insertions(+), 32 deletions(-) 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 ? ( - - ) : ( - - )} - - )} + ) : ( + + ))}
); } -- 2.44.1