mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2025-01-11 04:25:50 +00:00
parent
326beabda1
commit
61b6810466
1 changed files with 41 additions and 34 deletions
|
@ -97,6 +97,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
{this.adminButtons()}
|
{this.adminButtons()}
|
||||||
{this.subscribe()}
|
{this.subscribe()}
|
||||||
{this.canPost && this.createPost()}
|
{this.canPost && this.createPost()}
|
||||||
|
{this.blockCommunity()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card border-secondary mb-3">
|
<div class="card border-secondary mb-3">
|
||||||
|
@ -273,7 +274,6 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
createPost() {
|
createPost() {
|
||||||
let cv = this.props.community_view;
|
let cv = this.props.community_view;
|
||||||
return (
|
return (
|
||||||
cv.subscribed == SubscribedType.Subscribed && (
|
|
||||||
<Link
|
<Link
|
||||||
className={`btn btn-secondary btn-block mb-2 ${
|
className={`btn btn-secondary btn-block mb-2 ${
|
||||||
cv.community.deleted || cv.community.removed ? "no-click" : ""
|
cv.community.deleted || cv.community.removed ? "no-click" : ""
|
||||||
|
@ -282,24 +282,33 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
>
|
>
|
||||||
{i18n.t("create_a_post")}
|
{i18n.t("create_a_post")}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribe() {
|
subscribe() {
|
||||||
let community_view = this.props.community_view;
|
let community_view = this.props.community_view;
|
||||||
let blocked = this.props.community_view.blocked;
|
|
||||||
return (
|
return (
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
{community_view.subscribed == SubscribedType.NotSubscribed && (
|
{community_view.subscribed == SubscribedType.NotSubscribed && (
|
||||||
<>
|
|
||||||
<button
|
<button
|
||||||
class="btn btn-secondary btn-block"
|
class="btn btn-secondary btn-block"
|
||||||
onClick={linkEvent(this, this.handleSubscribe)}
|
onClick={linkEvent(this, this.handleSubscribe)}
|
||||||
>
|
>
|
||||||
{i18n.t("subscribe")}
|
{i18n.t("subscribe")}
|
||||||
</button>
|
</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
|
<button
|
||||||
class="btn btn-danger btn-block"
|
class="btn btn-danger btn-block"
|
||||||
onClick={linkEvent(this, this.handleUnblock)}
|
onClick={linkEvent(this, this.handleUnblock)}
|
||||||
|
@ -313,9 +322,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
>
|
>
|
||||||
{i18n.t("block_community")}
|
{i18n.t("block_community")}
|
||||||
</button>
|
</button>
|
||||||
)}
|
))}
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue