Show create post even if not subscribed. Fixes #768 (#789)

This commit is contained in:
Dessalines 2022-09-21 10:04:57 -04:00 committed by GitHub
parent 326beabda1
commit 61b6810466
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,6 +97,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
{this.adminButtons()}
{this.subscribe()}
{this.canPost && this.createPost()}
{this.blockCommunity()}
</div>
</div>
<div class="card border-secondary mb-3">
@ -273,7 +274,6 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
createPost() {
let cv = this.props.community_view;
return (
cv.subscribed == SubscribedType.Subscribed && (
<Link
className={`btn btn-secondary btn-block mb-2 ${
cv.community.deleted || cv.community.removed ? "no-click" : ""
@ -282,24 +282,33 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
>
{i18n.t("create_a_post")}
</Link>
)
);
}
subscribe() {
let community_view = this.props.community_view;
let blocked = this.props.community_view.blocked;
return (
<div class="mb-2">
{community_view.subscribed == SubscribedType.NotSubscribed && (
<>
<button
class="btn btn-secondary btn-block"
onClick={linkEvent(this, this.handleSubscribe)}
>
{i18n.t("subscribe")}
</button>
{blocked ? (
)}
</div>
);
}
blockCommunity() {
let community_view = this.props.community_view;
let blocked = this.props.community_view.blocked;
return (
<div class="mb-2">
{community_view.subscribed == SubscribedType.NotSubscribed &&
(blocked ? (
<button
class="btn btn-danger btn-block"
onClick={linkEvent(this, this.handleUnblock)}
@ -313,9 +322,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
>
{i18n.t("block_community")}
</button>
)}
</>
)}
))}
</div>
);
}